GHSA-cwv4-h3j5-w3cf: rama has Stored XSS in ServeDir HTML directory listing via unescaped file names and URI path
The plabayo/rama project contains a stored/reflected cross-site scripting (XSS) vulnerability in the ServeDir HTML directory listing feature when configured with DirectoryServeMode::HtmlFileList. File names and URI path components are inserted into the generated HTML without proper escaping, allowing an attacker who can control or influence file or directory names to inject malicious HTML or JavaScript. This can lead to script execution in the browsers of users viewing the directory listing. The vulnerability affects version 0.3.0-rc.1 of rama. A fix involves properly escaping all untrusted values before embedding them in HTML. The severity is assessed as medium due to the requirement for attacker control over file names and user interaction.
AI Analysis
Technical Summary
The vulnerability in plabayo/rama arises from the ServeDir component generating HTML directory listings without escaping file names and URI path parts. Specifically, when ServeDir is used with DirectoryServeMode::HtmlFileList, file and directory names are directly inserted into HTML link text and href attributes, as well as navigation breadcrumbs and page titles, without HTML or attribute escaping. This allows an attacker who can create or influence file or directory names in the served directory to inject arbitrary HTML or JavaScript, resulting in stored or reflected XSS. The vulnerability is demonstrated by creating files with names containing HTML metacharacters that execute JavaScript when the directory listing is viewed. The root cause is the use of string formatting (format!) without escaping untrusted input. The recommended fix is to apply proper HTML and attribute escaping to all untrusted values before insertion into the generated HTML. The affected version is 0.3.0-rc.1. No official patch link is provided in the data.
Potential Impact
If exploited, this vulnerability allows an attacker to execute arbitrary JavaScript in the browsers of users who visit the affected directory listing. This can lead to session or token theft, UI redressing, phishing attacks, unauthorized actions within the application origin, and compromise of security boundaries if the directory listing is served under a trusted domain. Exploitation requires the attacker to control or influence file or directory names and requires user interaction to view the malicious directory listing. The impact is limited to browser-side script execution within the application origin.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The suggested fix is to escape all untrusted values before inserting them into the generated HTML, including HTML-escaping file and directory names used as link text, attribute-escaping values used inside href attributes, and escaping URI path components used in breadcrumbs, page titles, and headings. Until a patch is available, avoid enabling ServeDir with DirectoryServeMode::HtmlFileList on directories where untrusted users can create or influence file or directory names.
GHSA-cwv4-h3j5-w3cf: rama has Stored XSS in ServeDir HTML directory listing via unescaped file names and URI path
Description
The plabayo/rama project contains a stored/reflected cross-site scripting (XSS) vulnerability in the ServeDir HTML directory listing feature when configured with DirectoryServeMode::HtmlFileList. File names and URI path components are inserted into the generated HTML without proper escaping, allowing an attacker who can control or influence file or directory names to inject malicious HTML or JavaScript. This can lead to script execution in the browsers of users viewing the directory listing. The vulnerability affects version 0.3.0-rc.1 of rama. A fix involves properly escaping all untrusted values before embedding them in HTML. The severity is assessed as medium due to the requirement for attacker control over file names and user interaction.
CVSS v3.1
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in plabayo/rama arises from the ServeDir component generating HTML directory listings without escaping file names and URI path parts. Specifically, when ServeDir is used with DirectoryServeMode::HtmlFileList, file and directory names are directly inserted into HTML link text and href attributes, as well as navigation breadcrumbs and page titles, without HTML or attribute escaping. This allows an attacker who can create or influence file or directory names in the served directory to inject arbitrary HTML or JavaScript, resulting in stored or reflected XSS. The vulnerability is demonstrated by creating files with names containing HTML metacharacters that execute JavaScript when the directory listing is viewed. The root cause is the use of string formatting (format!) without escaping untrusted input. The recommended fix is to apply proper HTML and attribute escaping to all untrusted values before insertion into the generated HTML. The affected version is 0.3.0-rc.1. No official patch link is provided in the data.
Potential Impact
If exploited, this vulnerability allows an attacker to execute arbitrary JavaScript in the browsers of users who visit the affected directory listing. This can lead to session or token theft, UI redressing, phishing attacks, unauthorized actions within the application origin, and compromise of security boundaries if the directory listing is served under a trusted domain. Exploitation requires the attacker to control or influence file or directory names and requires user interaction to view the malicious directory listing. The impact is limited to browser-side script execution within the application origin.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The suggested fix is to escape all untrusted values before inserting them into the generated HTML, including HTML-escaping file and directory names used as link text, attribute-escaping values used inside href attributes, and escaping URI path components used in breadcrumbs, page titles, and headings. Until a patch is available, avoid enabling ServeDir with DirectoryServeMode::HtmlFileList on directories where untrusted users can create or influence file or directory names.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-cwv4-h3j5-w3cf
- Osv Schema Version
- 1.4.0
- Aliases
- []
- Ecosystems
- ["crates.io"]
- Database Specific Severity
- LOW
- Cvss Version
- 3.1
Threat ID: 6a4e4ee7c9d9e3dbe3289b54
Added to database: 07/08/2026, 13:21:43 UTC
Last enriched: 07/08/2026, 13:40:37 UTC
Last updated: 07/09/2026, 01:02:16 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.