/

CVE-2026-54087

Severity:

HIGH RISK

(7.6)

Stored XSS (CWE-79) in EasyAdmin File/Image Uploads

CVE-2026-54087

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79, CWE-434

Impact:

Authenticated-origin JavaScript execution, session or CSRF token exposure, and potential privilege escalation

Severity:

HIGH RISK

(7.6)

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

EasyAdmin can store browser-executable HTML or SVG files and render them inline from the administrator-facing backend. If an attacker can upload such a file and a more privileged administrator opens it from the same origin, script execution may expose sensitive tokens or support privilege escalation.

Affected context

The issue can occur in EasyAdmin applications using FileField or ImageField when uploaded files are stored beneath the public web root and linked for inline browser rendering. Risk is highest when uploaders have fewer privileges than administrators who later view the stored files. The described behavior does not generally provide PHP or PHTML execution because the affected file-extension handling does not generate those stored extensions.

Exploit preconditions

  • Attack surface: An EasyAdmin form containing FileField or ImageField and an accessible upload workflow
  • Required access: Permission to submit an upload, potentially with fewer privileges than the eventual viewer
  • Storage condition: Uploaded content is reachable through the public web root
  • Trigger point: A privileged administrator opens the stored file through the backend
  • Why exploitation is possible: Browser-executable content is served from an application-controlled, same-origin URL without download-oriented response handling

Why this happens

The vulnerability results from insufficient separation between uploaded content and trusted application content. FileField and ImageField can accept HTML or SVG content, while the associated template links stored files for inline rendering without consistently forcing download behavior through a download attribute or an attachment-oriented Content-Disposition header. When a browser loads the content from the authenticated application origin, embedded script can execute in that origin, mapping primarily to CWE-79: Improper Neutralization of Input During Web Page Generation and secondarily to CWE-434: Unrestricted Upload of File with Dangerous Type.

Potential impact

  • An attacker may execute JavaScript in an authenticated administrator's origin
  • Session identifiers, CSRF tokens, or other browser-accessible data could be exposed
  • Administrative actions could be performed through the victim's session
  • The issue could enable privilege escalation or unauthorized configuration changes
  • Uploaded content could be used for persistent phishing or backend social engineering

General mitigation guidance

Mitigation generally focuses on treating uploads as untrusted data and preventing them from being interpreted as active same-origin content.

Common defensive patterns include:

  • Allowing only narrowly defined file types based on business need
  • Validating content using server-side type checks rather than trusting filenames or client metadata
  • Storing uploads outside the public web root where practical
  • Serving user-controlled files from an isolated origin or dedicated download endpoint
  • Forcing downloads with appropriate response headers instead of permitting inline rendering
  • Sanitizing SVG and HTML when those formats are genuinely required
  • Applying restrictive content security and framing policies
  • Ensuring uploaders and file viewers have appropriately separated privileges

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review of upload fields, file-serving controllers, and templates
  • Searches for user-controlled files rendered without download attributes or attachment-oriented Content-Disposition headers
  • Tests that upload HTML and SVG samples and verify they cannot execute in the application origin
  • Checks for public-web-root storage of untrusted files
  • Policy enforcement requiring isolated origins, safe content types, or download-only handling for uploads
  • Automated security review tools that identify unrestricted upload and stored XSS patterns

Sources

SourceLink
github.comgithub.com/EasyCorp/EasyAdminBundle/commit/8132b2b0ca3876c9261264fa267106a1b2c10a68
github.comgithub.com/EasyCorp/EasyAdminBundle/releases/tag/v5.0.13
github.comgithub.com/EasyCorp/EasyAdminBundle/security/advisories/GHSA-8559-gwj3-q37r

Frequently asked

questions

It can be exploitable through a remotely reachable EasyAdmin upload form when an attacker has permission to submit a file and a privileged user later opens it.

No. The key condition is a privilege gap: the attacker needs upload access, while the victim needs sufficient privileges to view the file and perform sensitive actions.

Treat uploads as untrusted, restrict accepted types, keep them outside the public web root where possible, and serve them as downloads or from an isolated origin rather than inline from the authenticated application origin.

Combine strict upload validation with least-privilege access controls, safe file-serving headers, isolated storage, and tests that verify browser-executable uploads cannot run with application-origin privileges.

Find out what's already
exploitable in your codebase.