Frappe Framework 17.0.0-dev - Stored XSS in frappe.get_avatar image rendering
4,6
Medium
Detected by

Fluid Attacks AI SAST Scanner
Disclosed by
Oscar Uribe
Summary
Full name
Frappe Framework 17.0.0-dev - Stored XSS in frappe.get_avatar image rendering
Code name
State
Public
Release date
Affected product
Frappe Framework
Vendor
Frappe
Affected version(s)
17.0.0-dev
Vulnerability name
Stored cross-site scripting (XSS)
Vulnerability type
Remotely exploitable
Yes
CVSS v4.0 vector string
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
CVSS v4.0 base score
4.6
Exploit available
Yes
CVE ID(s)
Description
A Stored Cross-Site Scripting (XSS) vulnerability exists in Frappe Framework version 17.0.0-dev due to improper neutralization of user-controlled input in the frappe.get_avatar function. The function interpolates the image_url value directly into an HTML template string and assigns the resulting markup to innerHTML without performing adequate HTML escaping or sanitization.
An attacker with write access to a record containing an image_field can persist a crafted Attach Image value containing malicious markup. When the affected record is rendered by components that consume frappe.get_avatar, the attacker-controlled payload is inserted into the DOM and executed in the context of the viewing user's session.
The sink is client-side innerHTML construction in frappe.get_avatar, where image_url is interpolated directly into an HTML template string without escaping.
Vulnerability
Case A: Link Preview preview_image -> frappe.get_avatar
Source persistence: attacker-controlled payload stored in an
Attach Imagefield (validated withItem.image).Sanitization gap: server-side XSS sanitizer excludes
Attach/Attach Imagefields.Server response:
frappe.desk.link_preview.get_preview_datareturnspreview_imagefrom the record'simage_field.Client propagation:
link_preview.jspassespreview_data.preview_imageintofrappe.get_avatar.Sink:
frappe.get_avatarinserts unescaped template content viael.innerHTML, including:style='background-image: url("${image_url}")'
Impact: crafted payload breaks out of the style context and executes JavaScript in the victim browser context.
Case B: Global Search image path
frappe.utils.global_search.searchcopiesdoc.get(meta.image_field)intor.image.search_utils.jsforwardsd.imageintoresult.image.search.jscallsfrappe.get_avatar(..., result.image).Same sink in
frappe.get_avatar.
Notes on weaker claims:
data_attributes(filterable=true) is a secondary vector with stricter source constraints.abbr/stylein the non-image branch are not required to prove the exploitability of the validatedimage_urlpath.
Relevant code:
frappe/frappe/public/js/frappe/utils/common.js:46-56frappe/frappe/public/js/frappe/utils/common.js:69-74frappe/frappe/public/js/frappe/ui/link_preview.js:212-221frappe/frappe/public/js/frappe/ui/link_preview.js:156-158frappe/frappe/desk/link_preview.py:41-44frappe/frappe/model/base_document.py:1383-1387frappe/frappe/utils/global_search.py:533-536frappe/frappe/public/js/frappe/ui/toolbar/search_utils.js:469-470frappe/frappe/public/js/frappe/ui/toolbar/search.js:329-333frappe/frappe/core/doctype/user/user.py:221-223frappe/frappe/core/doctype/user/user.py:650-653
PoC
Reproduction used in validation environment
Login and keep session cookie:
Create a temporary
Item:
Store payload in
Item.image(Attach Image):
Retrieve preview data and verify source reaches client:
In an authenticated Desk page, evaluate:
Expected result:
Browser executes
alert("XSS_AVATAR_9777").
Evidence of Exploitation
Static evidence:

Our security policy
We have reserved the ID CVE-2026-50700 to refer to this issue from now on.
System Information
Frappe Framework
Version 17.0.0-dev
Operating System: Any
References
Github Repository: https://github.com/frappe/frappe
Mitigation
There is currently no patch available for this vulnerability.
Credits
The vulnerability was discovered by Oscar Uribe from Fluid Attacks' Offensive Team using the AI SAST Scanner.
Timeline
Vulnerability discovered
Vendor contacted
Vendor replied
Public disclosure
Does your application use this vulnerable software?
During our free trial, our tools assess your application, identify vulnerabilities, and provide recommendations for their remediation.













