Description
Mongoose is an embedded web server and network library. Prior to 7.22, a remote attacker can send a crafted percent-encoded request path to a deployment using MG_ENABLE_DIRLIST and persuade a user to visit it. The mg_http_serve_dir() and listdir() path in src/http.c places the decoded request URI into the title and h1 elements without HTML entity encoding. The resulting reflected cross-site scripting executes in the Mongoose origin and can expose session data or perform actions as the victim. This issue is fixed in version 7.22.
Published: 2026-08-20
Score: 5.4 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

A percent‑encoded request path directed to a directory listing endpoint in Mongoose 7.21 and earlier places the decoded URI directly into the HTML title and h1 tags without escaping, allowing a reflected cross‑site scripting attack. When a vulnerable user visits the crafted URL, the browser executes the embedded script in the context of the Mongoose origin, which can compromise session data or perform actions on behalf of that user.

Affected Systems

Cesanta’s Mongoose web server, versions earlier than 7.22. Any deployment using the MG_ENABLE_DIRLIST option is susceptible, including all 7.x releases prior to the 7.22 fix.

Risk and Exploitability

The CVSS score of 5.4 indicates moderate severity and an attack vector that requires network access to the HTTP endpoint. The EPSS score is not available, so exploitation likelihood cannot be quantified, and the vulnerability is not listed in the CISA KEV catalog. An attacker must craft a percent‑encoded path and persuade a victim to visit the URL; no privilege escalation is required, but the impact is limited to the victim’s session. The vulnerability would be exploitable as long as directory listings remain enabled on a reachable instance of any affected Mongoose version.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to Mongoose version 7.22 or later, which removes the unescaped decoded URI from the directory listing output.
  • If upgrading is not immediately possible, disable the MG_ENABLE_DIRLIST option to prevent directory listings from being served.
  • As a temporary safeguard, verify that other dynamic content rendered by Mongoose is properly HTML‑escaped to mitigate similar XSS risks in the codebase.

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

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 20 Aug 2026 18:45:00 +0000

Type Values Removed Values Added
First Time appeared Cesanta
Cesanta mongoose
Vendors & Products Cesanta
Cesanta mongoose

Thu, 20 Aug 2026 17:45:00 +0000

Type Values Removed Values Added
Description Mongoose is an embedded web server and network library. Prior to 7.22, a remote attacker can send a crafted percent-encoded request path to a deployment using MG_ENABLE_DIRLIST and persuade a user to visit it. The mg_http_serve_dir() and listdir() path in src/http.c places the decoded request URI into the title and h1 elements without HTML entity encoding. The resulting reflected cross-site scripting executes in the Mongoose origin and can expose session data or perform actions as the victim. This issue is fixed in version 7.22.
Title Mongoose: Reflected XSS via decoded URI in directory listing render
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'}


Subscriptions

Cesanta Mongoose
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-20T17:39:16.147Z

Reserved: 2026-08-11T17:18:01.598Z

Link: CVE-2026-73259

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-20T18:16:47.730

Modified: 2026-08-20T18:16:47.730

Link: CVE-2026-73259

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-20T18:30:03Z

Weaknesses
  • CWE-79

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