Skip to main content

mammoth CVE-2025-11849

MEDIUM
Path Traversal (CWE-22)
2025-10-17 report@snyk.io
5.4
CVSS 4.0 · Vendor: snyk
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft docx with r:link pointing to target file
  2. Delivery
    Upload docx to mammoth-backed conversion service
  3. Exploit
    mammoth resolves URI to local filesystem path
  4. Execution
    File content read and base64-encoded
  5. Persist
    Sensitive data embedded in HTML output as data URI
  6. Impact
    Attacker retrieves file contents from response

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The following conditions are all required: (1) the target application uses mammoth to convert .docx files supplied or influenced by an attacker; (2) the version of mammoth installed is between 0.3.25 and 1.10.x inclusive (i.e., before 1.11.0); (3) on versions prior to 1.11.0 with default settings, externalFileAccess defaults to true - no additional configuration is required to be vulnerable; (4) the crafted docx must contain an image referencing a r:link external URI rather than the standard r:embed embedded blob. Exploitation is limited by the requirement that a user or automated process must trigger the conversion (UI:P); the attacker cannot directly invoke mammoth. The process running mammoth must have read access to the targeted file. On versions ≥1.11.0, external file access is off by default, so applications that explicitly set externalFileAccess: true to process trusted documents and then inadvertently accept untrusted input would remain vulnerable.

Impact

The provided CVSS 4.0 vector scores 5.4 (Medium), driven by UI:P (passive user interaction required) and a scope model that places the file system impact on the subsequent system (SC:H/SA:H) rather than the vulnerable component. In practice, the confidentiality risk is higher than the numeric score suggests: any service that accepts user-supplied .docx files and returns HTML conversion output is directly vulnerable to sensitive file disclosure - including cloud document converters, CMS import pipelines, and CI/CD document processors. EPSS is low at 0.23% (46th percentile), consistent with no known KEV listing, though a public proof-of-concept gist exists (E:P in the CVSS 4.0 vector), confirming exploitability is not merely theoretical. The multi-ecosystem footprint (four package managers) broadens effective exposure. The DoS vector via /dev/zero is real but secondary. Overall priority: patching is low-friction (single version bump across all ecosystems), and the real-world risk to document-processing services is higher than CVSS 5.4 alone implies.

Exploit ScenarioDerived

An attacker uploads a crafted .docx file to a web application that uses mammoth for document preview or conversion. The docx contains an image element with r:link pointing to a sensitive file such as /etc/shadow or an application's private key at /app/config/secrets.env. The service calls mammoth.convertToHtml() without explicitly disabling external file access, mammoth reads the target file and base64-encodes its contents into an <img src='data:...'> tag, and the attacker retrieves the full file content from the returned HTML. A public proof-of-concept demonstrating this technique is available on GitHub Gist.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 16, 2026

Arbitrary file read and resource exhaustion in the mammoth document conversion library (all language editions: JS, Python, Java, .NET) affects versions 0.3.25 through 1.10.x. When converting a crafted .docx file whose images reference external URIs via the r:link attribute, mammoth resolves those URIs to host filesystem paths, reads the file, and embeds the content as a base64 data URI in the HTML output - exposing the contents of any file readable by the conversion process to whoever receives the HTML. A second vector allows denial-of-service by linking to character device files such as /dev/zero. A proof-of-concept exists (linked Gist), but no confirmed active exploitation is recorded in CISA KEV.

RemediationAI

Upgrade to mammoth version 1.11.0 or later across whichever package manager applies (npm, PyPI, Maven Central, or NuGet). The fix changes the default of externalFileAccess to false, so upgrading alone is sufficient for most deployments. If upgrading is temporarily blocked, pass {externalFileAccess: false} (JS/Python) or the equivalent option in Java/.NET to explicitly disable external file resolution - this option existed before 1.11.0 but was opt-in rather than the default. Do not enable externalFileAccess: true unless the source .docx files are from fully trusted, controlled sources; enabling it on user-supplied documents restores the vulnerability. The upstream commit is c54aaeb43a7941317c1f3c119ffa92090f988820 on the mammoth.js repository; patch availability is confirmed by the Snyk advisories and the commit itself.

Affected Packages

maven mammoth fix: 1.11.0
maven org.zwobble.mammoth:mammoth fix: 1.11.0
npm mammoth fix: 1.11.0
npm org.zwobble.mammoth:mammoth fix: 1.11.0
nuget mammoth fix: 1.11.0
nuget org.zwobble.mammoth:mammoth fix: 1.11.0
pypi mammoth fix: 1.11.0
pypi org-zwobble-mammoth:mammoth fix: 1.11.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in maven, npm, nuget and 1 more

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

mammoth is a multi-platform .docx-to-HTML conversion library available on npm (mammoth), PyPI (mammoth), Maven Central (org.zwobble.mammoth:mammoth), and NuGet (Mammoth). OOXML .docx containers support two image reference modes: embedded blobs (r:embed) and external URIs (r:link). Prior to version 1.11.0, mammoth unconditionally resolved r:link URIs to local filesystem paths (CWE-22: Improper Limitation of a Pathname to a Restricted Directory). There was neither a path prefix restriction nor a file-type/scheme allowlist, so any path reachable by the OS process - including /etc/passwd, private keys, or Unix device nodes - could be captured. The fix (commit c54aaeb) inverts the default of externalFileAccess from true to false, blocking all external file access unless the caller explicitly opts in with {externalFileAccess: true}, which is now documented as appropriate only for trusted documents.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (snyk) PRIMARY 5.4 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:N/SA:H/E:P
vuln.today AI 8.2 HIGH

No privileges needed to submit a docx; UI:R because conversion must be triggered; scope change as host filesystem is read; C:H for arbitrary file disclosure; A:L for limited /dev/zero DoS.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (snyk).

CVSS VectorVendor: snyk

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
High
Subsequent system: Integrity
None
Subsequent system: Availability
High

DescriptionCVE.org

Versions of the package mammoth from 0.3.25 and before 1.11.0; versions of the package mammoth from 0.3.25 and before 1.11.0; versions of the package mammoth before 1.11.0; versions of the package org.zwobble.mammoth:mammoth before 1.11.0 are vulnerable to Directory Traversal due to the lack of path or file type validation when processing a docx file containing an image with an external link (r:link attribute instead of embedded r:embed). The library resolves the URI to a file path and after reading, the content is encoded as base64 and included in the HTML output as a data URI. An attacker can read arbitrary files on the system where the conversion is performed or cause an excessive resources consumption by crafting a docx file that links to special device files such as /dev/random or /dev/zero.

Threat Intelligence Overview

EPSS Score
0.2%
Top 54% exploitable
Prevalence
Medium
popular open-source docx-to-HTML library across four ecosystems
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy