Summary
Frappe ERPNext contains a stored cross-site scripting vulnerability in a profile field that is rendered on portal pages without proper escaping. A low-privilege attacker who can save malicious content in that field may cause script to execute in an administrator's browser, potentially enabling account takeover.
Frappe ERPNext contains a stored cross-site scripting vulnerability in a profile field that is rendered on portal pages without proper escaping. A low-privilege attacker who can save malicious content in that field may cause script to execute in an administrator's browser, potentially enabling account takeover.
Affected context
The issue may occur in ERPNext deployments where:
- A low-privilege user can edit or submit the affected profile field
- The field value is displayed on portal pages
- The value is inserted into rendered output without context-appropriate escaping
- An administrator views a page containing the stored value
Risk depends on the permissions available to create or modify profile data and on how administrators interact with affected portal pages.
The issue may occur in ERPNext deployments where:
- A low-privilege user can edit or submit the affected profile field
- The field value is displayed on portal pages
- The value is inserted into rendered output without context-appropriate escaping
- An administrator views a page containing the stored value
Risk depends on the permissions available to create or modify profile data and on how administrators interact with affected portal pages.
Exploit preconditions
- Attack surface: Portal pages that render profile information
- Required access: Low-privilege access sufficient to store content in the affected profile field
- Trigger point: An administrator views a portal page containing the stored value
- Why exploitation is possible: User-controlled content is rendered without adequate output encoding, allowing browser-interpreted script to execute in the administrator's session context
- Attack surface: Portal pages that render profile information
- Required access: Low-privilege access sufficient to store content in the affected profile field
- Trigger point: An administrator views a portal page containing the stored value
- Why exploitation is possible: User-controlled content is rendered without adequate output encoding, allowing browser-interpreted script to execute in the administrator's session context
Why this happens
The underlying bug is a failure to apply context-appropriate output encoding to a user-controlled profile field before rendering it in portal pages. This creates a persistent injection point: attacker-supplied content is stored by the application and later treated as active browser markup or script when viewed by another user. The behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly called cross-site scripting.
The underlying bug is a failure to apply context-appropriate output encoding to a user-controlled profile field before rendering it in portal pages. This creates a persistent injection point: attacker-supplied content is stored by the application and later treated as active browser markup or script when viewed by another user. The behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly called cross-site scripting.
Potential impact
- An attacker may perform actions in an administrator's authenticated browser session
- Administrative account credentials or session information could be exposed, depending on browser and application controls
- Application settings or business data could be modified
- Additional users may be targeted through repeated viewing of affected pages
- The application may experience unauthorized administrative changes or data exposure
- An attacker may perform actions in an administrator's authenticated browser session
- Administrative account credentials or session information could be exposed, depending on browser and application controls
- Application settings or business data could be modified
- Additional users may be targeted through repeated viewing of affected pages
- The application may experience unauthorized administrative changes or data exposure
General mitigation guidance
Mitigation generally focuses on ensuring that untrusted profile data is treated as data rather than executable browser content.
Common defensive patterns include:
- Applying context-aware output encoding at every rendering sink
- Using templating systems with auto-escaping enabled by default
- Allowing HTML only through narrowly scoped, sanitized allowlists when rich text is required
- Reducing trust in user-editable profile fields and validating content against an explicit schema
- Applying restrictive Content Security Policy controls as defense in depth
- Limiting administrative privileges and reducing the impact of compromised administrator sessions
- Avoiding unsafe rendering modes unless the content has been securely sanitized for its exact context
Mitigation generally focuses on ensuring that untrusted profile data is treated as data rather than executable browser content.
Common defensive patterns include:
- Applying context-aware output encoding at every rendering sink
- Using templating systems with auto-escaping enabled by default
- Allowing HTML only through narrowly scoped, sanitized allowlists when rich text is required
- Reducing trust in user-editable profile fields and validating content against an explicit schema
- Applying restrictive Content Security Policy controls as defense in depth
- Limiting administrative privileges and reducing the impact of compromised administrator sessions
- Avoiding unsafe rendering modes unless the content has been securely sanitized for its exact context
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying unescaped user-controlled values in templates and response builders
- Code review checks for raw HTML rendering, disabled auto-escaping, and unsafe DOM insertion
- Tests that submit encoded and markup-like values through profile fields and verify safe rendering
- Repository searches for rendering APIs that bypass escaping or sanitization
- Web application monitoring for unexpected script-like content in profile data and unusual administrative actions
- Policy enforcement requiring approved sanitization libraries and security checks for user-controlled output
Automated code review and web application testing tools may help identify these patterns, but findings should be validated in the relevant rendering context.
Organizations can look for this class of issue through:
- Static analysis rules identifying unescaped user-controlled values in templates and response builders
- Code review checks for raw HTML rendering, disabled auto-escaping, and unsafe DOM insertion
- Tests that submit encoded and markup-like values through profile fields and verify safe rendering
- Repository searches for rendering APIs that bypass escaping or sanitization
- Web application monitoring for unexpected script-like content in profile data and unusual administrative actions
- Policy enforcement requiring approved sanitization libraries and security checks for user-controlled output
Automated code review and web application testing tools may help identify these patterns, but findings should be validated in the relevant rendering context.

