Skip to content

Chained XSS and CSRF Vulnerabilities Enable Admin Account Takeover

High
gantoine published GHSA-v3c6-w996-f7hx Dec 3, 2025

Package

romm

Affected versions

<4.4.1, 4.4.1-beta.1

Patched versions

>=4.4.1, 4.4.1-beta.2

Description

Summary

RomM contains multiple unrestricted file upload vulnerabilities that allow authenticated users to upload malicious SVG or HTML files. When these files are accessed the browser executes embedded JavaScript, leading to stored Cross-Site Scripting (XSS) which when combined with a CSRF misconfiguration they lead to achieve full administrative account takeover, creating a rogue admin account, escalating the attacker account role to admin, and much more.

Affected Version: 4.4.0 (latest Docker image at time of testing - November 2025)


Details

I found 2 issues if chained together would lead to admin ATO and much more, these 2 issues are CSRF misconfiguration & XSS via arbitrary file upload.

CSRF Misconfiguration

[REDACTED]

Affected Code

Affected backend code exists in 2 files (main.py & handler/auth/middleware.py)

Mitigation / Fix

Bind CSRF token to user's session instead of using a Global Tokens Pool.

Arbitrary File Upload leading to Cross-Site-Scripting (XSS)

[REDACTED]

Affected Code

[REDACTED]

Mitigation / Fix
  • Create a whitelist for the allowed files formats (e.g. png, jpg, jpeg)
  • Do some other checks on the uploaded file such as checking the MIME type, magic bytes, or actual file format.
  • Also check the uploaded file size to avoid malicious users uploading large files leading to Denial-of-Service (DoS) attacks.
    • If it's intended to let users upload their Saves/States as large as they want, at least do some checks when it comes to users avatar or ROMs covers and other endpoints only needs images.

Admin Account Takeover

Chaining the above 2 issues leads to several critical impact, but I'll focus on Taking over the Admin's account for simplicity since fixing the root cause would fix the rest of the attack scenarios.
We can use any of the above arbitrary file upload, but I'd use the Avatar one in this Proof-of-Concept.

[REDACTED]

Mitigation / Fix
  • Fix both issues, CSRF & Unrestricted file upload like mentioned above
  • Plus, on the change password function, require the old password.

Impact

Chaining CSRF misconfiguration + XSS via arbitrary file upload allows an authenticated low privileged user to do:

  • Admin account takeover (password change without the need of an old password)
  • Rogue admin account creation
  • Privilege escalation (viewer/editor → admin)
  • Account deletion/disable
  • Full application compromise

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:H

CVE ID

CVE-2025-65027

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Cross-Site Request Forgery (CSRF)

The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. Learn more on MITRE.

Unrestricted Upload of File with Dangerous Type

The product allows the upload or transfer of dangerous file types that are automatically processed within its environment. Learn more on MITRE.

Credits