/

CVE-2026-28436

Severity:

HIGH RISK

(7.2)

Cross-Site Scripting (XSS) in Frappe Avatar Image URLs

CVE-2026-28436

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to client-side code execution in victims' browsers

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A stored cross-site scripting (XSS) vulnerability in Frappe allows attackers to inject malicious scripts via crafted avatar image URLs.

When other users view pages where the avatar is rendered, such as website comments, the injected script may execute in their browser, enabling session theft or unwanted actions within their account context.

Affected context

The vulnerability occurs in Frappe applications that display user avatars based on user-supplied image URLs without sufficient sanitization or encoding.

It is particularly relevant on website pages that render public-facing comments or profiles, where avatars associated with user content are automatically displayed to other visitors.

The issue arises when the application treats the avatar URL as safe content and incorporates it into the page in a way that allows script execution.

Exploit preconditions

  • Attack surface: Web UI where avatars tied to user accounts or comments are rendered.
  • Required access: Ability to set or influence an avatar image URL, such as editing a profile or submitting a comment that references an avatar.
  • Trigger point: Any page view by another user (including authenticated users) where the crafted avatar is displayed in the browser.
  • Why exploitation is possible: The application does not adequately validate, sanitize, or encode user-supplied avatar URLs, allowing attacker-controlled content to be interpreted as executable script in the DOM.

Why this happens

The root cause is a classic stored XSS pattern where untrusted data is rendered into HTML without appropriate output encoding.

Specifically mapped to CWE-79, the bug arises because user-controlled avatar URLs are assumed to be benign and are inserted into the page in a context that can break out of expected markup or script boundaries.

This insecure pattern allows attackers to store a malicious payload on the server and have it served to other users, where it runs with the privileges of their browser session for that origin.

Potential impact

  • Theft of session identifiers or authentication tokens via injected scripts.
  • Execution of arbitrary JavaScript in other users' browsers within the Frappe application origin.
  • Unauthorized actions performed on behalf of victims (e.g., modifying data, posting content, changing settings).
  • Defacement of application pages or injection of misleading UI elements and phishing prompts.
  • Potential pivoting to further attacks by exfiltrating sensitive data accessible via the web interface.

General mitigation guidance

Effective mitigation focuses on treating all user-supplied data, including URLs, as untrusted and carefully controlling how it is rendered:

  • Apply strict output encoding appropriate to the context (HTML, attribute, JavaScript, or URL) whenever inserting user data into templates.
  • Validate avatar URLs against an allowlist of safe schemes (e.g., https) and reject or normalize anything that does not meet expected patterns.
  • Prefer rendering avatars from server-controlled locations, such as storing validated images and serving them from trusted paths rather than embedding attacker-supplied URLs directly.
  • Use security-conscious templating and component frameworks that automatically escape user data by default.
  • Enforce a Content Security Policy (CSP) to reduce the impact of any remaining XSS bugs, for example by disallowing inline scripts and restricting script sources.

How teams detect issues like this

Detection generally involves both code-level and behavior-level approaches:

  • Use static analysis or linters to scan templates and views for direct insertion of user-controlled fields (like avatar_url) into HTML attributes or script blocks without encoding.
  • During code review, flag patterns where URLs from user profiles or comments are interpolated into src, href, or style attributes without validation or context-aware escaping.
  • Implement security testing (including automated scanners and manual penetration tests) focused on comment systems, profile pages, and other areas where avatars are displayed.
  • Monitor application logs and client-side error tracking for suspicious markup or repeated rendering errors that may indicate XSS payloads being served.

Sources

SourceLink
github.comgithub.com/frappe/frappe/security/advisories/GHSA-vm63-r48g-7wqh

Frequently asked

questions

Yes. An attacker can exploit it remotely by submitting or configuring a malicious avatar URL in a way that other users will later view, causing their browsers to execute the injected script.

It depends on how the Frappe application is configured. If setting an avatar or posting comments requires an account, basic authentication may be necessary. In more open deployments where public users can influence avatars or comments, the attack could be conducted without prior authentication.

The safest course is to enforce strict validation of avatar URLs, store and serve images from trusted domains, and ensure all user-controlled fields are contextually HTML-encoded before rendering. Avoid inserting raw user input into HTML attributes or scripts.

Adopt a secure-by-default templating approach, enforce central encoding utilities for all output, apply input validation and allowlisting for URLs, and include XSS checks as part of code review, automated testing, and CI security gates. A well-tuned Content Security Policy can provide additional defense-in-depth.

Find out what's already
exploitable in your codebase.