CVE-2026-73254

Mongoose: Stored XSS via unescaped filenames in directory listing

Published Aug 20, 2026 CVSS 3.1 · 5.4 Medium EPSS < 1% KEV · Not listed
Description
Mongoose is an embedded web server and network library. Prior to 7.22, an attacker who can create a file with an HTML payload in its name can trigger stored cross-site scripting when a user browses a directory served with MG_ENABLE_DIRLIST. The printdirentry() path called by listdir() in src/http.c URL-encodes the href but inserts the raw filesystem filename into the HTML link text. The browser executes the injected markup in the Mongoose origin, which can expose session data or permit actions as the victim. This issue is fixed in version 7.22.

Analysis

AI-generated

Technical impact

Mongoose, an embedded web server, stored a cross‑site scripting flaw in directory listings. File names that contained arbitrary HTML were inserted unescaped into the body of the directory page. A browser visiting that page would interpret the injected markup within the Mongoose origin, allowing the attacker to steal session cookies or perform privileged actions as the user. The weakness is a classic reflected input problem (CWE‑79).

Affected Systems

Cesanta’s Mongoose web server in versions before 7.22. Any deployments that enable directory listing (MG_ENABLE_DIRLIST) are vulnerable, regardless of other access controls. Upgrade to 7.22 or later to eliminate the bug.

Risk and Exploitability

The CVSS score is 5.4, indicating medium severity. An attacker must be able to create a file on the filesystem served by Mongoose and reach a user who views the directory list; this is feasible in shared hosting or misconfigured sites. EPSS data is unavailable and the vulnerability is not listed in the CISA KEV catalog, meaning there is no immediate evidence of widespread exploitation. Given these constraints, the risk remains moderate while the potential impact can be significant due to XSS.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Mongoose to version 7.22 or later, which removes the unescaped filename insertion.
  • Configure the server to disable directory listings (disable MG_ENABLE_DIRLIST) if the feature is not required.
  • If an upgrade is not yet possible, sanitize filenames to strip or escape HTML before displaying them in listings, or use a whitelist to allow only safe characters.

Generated by OpenCVE AI on August 20, 2026 at 20:00 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:cesanta:mongoose:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Cesanta
Cesanta mongoose
Vendors & Products Cesanta
Cesanta mongoose
Type Values Removed Values Added
Description Mongoose is an embedded web server and network library. Prior to 7.22, an attacker who can create a file with an HTML payload in its name can trigger stored cross-site scripting when a user browses a directory served with MG_ENABLE_DIRLIST. The printdirentry() path called by listdir() in src/http.c URL-encodes the href but inserts the raw filesystem filename into the HTML link text. The browser executes the injected markup in the Mongoose origin, which can expose session data or permit actions as the victim. This issue is fixed in version 7.22.
Title Mongoose: Stored XSS via unescaped filenames in directory listing
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 5.4, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N'}

Weaknesses
  • CWE-79

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 21, 2026, 4:22 PM
Reserved
Aug 11, 2026, 5:18 PM
Status
Analyzed
Published
Aug 20, 2026, 6:16 PM
Modified
Oct 18, 2026, 8:10 PM