Skip to content
Noroxi
OSV ecosystem advisory

GHSA-cwv4-h3j5-w3cf: rama has Stored XSS in ServeDir HTML directory listing via unescaped file names and URI path

LowCVSS 3.7 · v3.1—No exploit Fix available

Noroxi assessment

Priority: Monitor (action score 14/100)

  • The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
  • Someone with local access to the system can trigger it. Administrator privileges are required. A user must open a link or visit a page. Special conditions such as timing or configuration are required.
  • Fixed version: rama (crates.io) 0.3.0-rc.1.

Low priority for now. Upgrade to rama (crates.io) 0.3.0-rc.1 or later.

Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it

Primary sources: OSV

Resolved: https://github.com/plabayo/rama/commit/89ddff578fd78bbebec99482d7030f28c07757a3 ## Summary `plabayo/rama` contains a stored/reflected cross-site scripting issue in the `ServeDir` HTML directory listing feature. When `ServeDir` is configured with `DirectoryServeMode::HtmlFileList`, file names and URI path components are inserted directly into generated HTML without HTML escaping. If an attacker can create or influence a file or directory name inside a served directory, they may inject HTML or JavaScript into the directory listing page. This can execute script in the browser of any user who visits the affected directory listing. ## Affected Repository `plabayo/rama` ## Affected Component `rama-http/src/service/fs/serve_dir/open_file.rs` ## Root Cause The HTML directory listing is constructed using string formatting and inserts untrusted values directly into HTML. The directory listing row includes the file or directory name in both the link text and the `href` attribute: rows.push(format!( "<tr><td>{5} <a href=\"{1}{2}{0}\">{0}</a></td><td>{3}</td><td>{4}</td></tr>", entry.name, uri.path().trim_end_matches('/'), ... )); The navigation breadcrumb also inserts URI path parts into generated HTML: nav_parts.push(format!("<a href=\"{current_path}\">{part}</a>")); The page title and heading also include the current URI path: <title>Directory listing for .{0}</title> <h1>Directory listing for .{0}</h1> These values are not HTML-escaped before being embedded into the generated page. ## Security Impact If an application uses `ServeDir` with `DirectoryServeMode::HtmlFileList`, an attacker who can create or influence file names inside the served directory can inject HTML or JavaScript into the generated directory listing. Possible impact includes: - Script execution in the browser of users viewing the directory listing - Session or token theft if the application uses cookies or browser-accessible credentials - UI redressing or phishing inside the application origin - Unauthorized actions within the same origin if the victim is authenticated - Security boundary impact if the directory listing is served under a trusted application domain The attack requires the directory listing feature to be enabled and the attacker to control or influence at least one file or directory name in the served path. ## Proof of Concept This proof of concept uses a benign payload. Create a directory with a file name containing HTML: mkdir rama-xss-test cd rama-xss-test touch '"><img src=x onerror=alert(document.domain)>.txt' Serve this directory with Rama using `ServeDir` and `DirectoryServeMode::HtmlFileList`. Example intended configuration: ServeDir::new("rama-xss-test") .with_directory_serve_mode(DirectoryServeMode::HtmlFileList) Then visit the directory listing in a browser. Expected behavior: The file name should be displayed as text. Special characters such as `<`, `>`, `"`, and `'` should be HTML-escaped. Actual behavior: The file name is inserted directly into the generated HTML. The browser interprets the injected HTML and executes the benign JavaScript payload. ## Expected Behavior All file names, directory names, URI path parts, and other untrusted values should be escaped before being inserted into HTML. For example: - `<` should become `&lt;` - `>` should become `&gt;` - `"` should become `&quot;` - `'` should become `&#x27;` - `&` should become `&amp;` Untrusted values used inside HTML attributes should be escaped using an attribute-safe escaping function. ## Actual Behavior The directory listing is generated with `format!()` and inserts file names and path values directly into HTML without escaping. ## Suggested Fix Escape all untrusted values before inserting them into the generated HTML. Recommended changes: 1. HTML-escape `entry.name` before using it as link text. 2. Attribute-escape values used inside `href`. 3. HTML-escape URI path components used in breadcrumbs. 4. HTML-escape the current path used in the page title and heading. 5. Add regression tests with file names containing HTML metacharacters. Example test payloads: "><img src=x onerror=alert(1)>.txt <script>alert(1)</script>.txt a&b.txt quote"test.txt single'test.txt The secure output should render these as text only and should not create executable HTML or JavaScript. ## Suggested Severity Medium. Suggested CVSS: `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N` Rationale: - The vulnerability is remotely reachable when an application exposes `ServeDir` directory listings. - Exploitation requires the attacker to create or influence a file or directory name in the served directory. - User interaction is required because a victim must view the affected directory listing. - The impact is browser-side script execution in the application origin. - Scope may change if the listing is served under a trusted authenticated application origin. ## Additional Notes This report is limited to the HTML directory listing generated by `ServeDir` when `DirectoryServeMode::HtmlFileList` is enabled. This report is not claiming remote code execution on the server. The issue is browser-side cross-site scripting caused by unescaped file names and path values in generated HTML.

Published
Jul 7, 2026
Updated
Jul 7, 2026
EPSS
—

Report tools

JSON

Action score

14

Monitor

Low priority for now.

CVSS
14 / 40 · 3.7 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · —

Get told when this record changes

  • Not in KEV: no record of exploitation in the wild
  • No public exploit code on record
  • A fix has been released

If any of these changes, we'll tell you in the daily email digest.

Follow GHSA-cwv4-h3j5-w3cf

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits every 10 minutes on paid plans, on the hour on the free plan.

Your free account also gets you

  • CVE alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools, at most 30 a day (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools
Is your version affected? Check it

Noroxi analysis

What does it mean in your environment?

The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.

We use this product, ask for help

Affected systems

Is your version affected?

Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.

VendorProduct
crates.iorama

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
crates.ioramabefore 0.3.0-rc.10.3.0-rc.1

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
crates.io:rama0.3.0-rc.1Package registry (OSV)

Exploit status

No known public exploit

No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

No dated events beyond publication.

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.

Technical details

Attack conditions

  • Someone with local access to the system can trigger it.
  • Administrator privileges are required.
  • A user must open a link or visit a page.
  • Special conditions such as timing or configuration are required.

If successful

Confidentiality
low · data can be read
Integrity
low · data or configuration can be modified
Availability
none

Impact can extend beyond the vulnerable component (scope changes).

Attack vector
Local
Attack complexity
High
Privileges required
High
User interaction
Required
Scope
Changed
Confidentiality impact
Low
Integrity impact
Low
Availability impact
None

CVSS vector

CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:N

osv

Attack context

MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.

References

Show all references (2 more)

Vendor advisories and official records. Exploit/PoC links are deliberately left out.

All records