CVE-2026-26831

OS Command Injection via Malicious Filenames in textract 2.5.0

Published Mar 25, 2026 CVSS 3.1 · 9.8 Critical EPSS 2.8% KEV · Not listed
Description
textract through 2.5.0 is vulnerable to OS Command Injection via the file path parameter in multiple extractors. When processing files with malicious filenames, the filePath is passed directly to child_process.exec() in lib/extractors/doc.js, rtf.js, dxf.js, images.js, and lib/util.js with inadequate sanitization

Analysis

AI-generated

Technical impact

textract through version 2.5.0 allows an attacker to inject arbitrary operating system commands by supplying a malicious filename that is passed directly to child_process.exec in several extractor modules. This flaw maps to CWE-78 and CWE-94. An attacker who can influence the filename can execute commands on the host system, leading to full compromise of the application server and the underlying operating system.

Affected Systems

The affected product is the open‑source npm library textract. Versions 2.5.0 and earlier are vulnerable. Applications built on Node.js that depend on this package and process files with user-supplied names are at risk. No other vendors or products are listed in the CNA data.

Risk and Exploitability

The CVSS score of 9.8 marks this as a critical vulnerability. The EPSS score of 3% indicates a moderate likelihood that the flaw may be exploited in the wild. It is not included in CISA’s KEV catalog. The likely attack vector is an attacker providing a specially crafted filename that reaches the child_process.exec call; this requires the application to accept and process untrusted file names. If such a file name is processed, arbitrary commands are executed with the privileges of the Node.js process.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade textract to any release that removes the unsanitized exec usage—any version newer than 2.5.0 includes the fix.
  • If an upgrade cannot be performed immediately, validate all file path inputs to allow only expected characters (e.g., alphanumerics, path separators) and reject any names containing shell metacharacters before passing them to textract.
  • Modify the application to avoid using the textract extractor modules that spawn child processes; instead, use safer, built‑in parsing logic or an alternative library that does not rely on exec for file handling.

Generated by OpenCVE AI on October 25, 2026 at 21:12 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-9pcj-m5rr-p28g textract is vulnerable to OS Command Injection
History
Type Values Removed Values Added
Title OS Command Injection via Malicious Filenames in textract 2.5.0
Type Values Removed Values Added
Title OS Command Injection via File Path in textract
Type Values Removed Values Added
Title OS Command Injection via File Path in textract
Type Values Removed Values Added
Title OS Command Injection via Unsanitized File Path in textract
Type Values Removed Values Added
Title OS Command Injection via Unsanitized File Path in textract
Type Values Removed Values Added
Title OS Command Injection in textract via Untrusted File Names
Type Values Removed Values Added
Weaknesses CWE-78
CPEs cpe:2.3:a:dbashford:textract:*:*:*:*:*:node.js:*:*
Type Values Removed Values Added
Title OS Command Injection in textract via Untrusted File Names
Type Values Removed Values Added
Weaknesses CWE-94
Metrics cvssV3_1

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

ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Title OS Command Injection in textract via unsanitized file path
Weaknesses CWE-78
Type Values Removed Values Added
Title OS Command Injection in textract via unsanitized file path
Weaknesses CWE-78
Type Values Removed Values Added
Title OS Command Injection via Malicious File Paths in textract Package
Weaknesses CWE-20
CWE-78
Type Values Removed Values Added
First Time appeared Dbashford
Dbashford textract
Vendors & Products Dbashford
Dbashford textract
Type Values Removed Values Added
Title OS Command Injection via Malicious File Paths in textract Package
Weaknesses CWE-20
CWE-78
Type Values Removed Values Added
Description textract through 2.5.0 is vulnerable to OS Command Injection via the file path parameter in multiple extractors. When processing files with malicious filenames, the filePath is passed directly to child_process.exec() in lib/extractors/doc.js, rtf.js, dxf.js, images.js, and lib/util.js with inadequate sanitization
References
Weaknesses
  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Mar 28, 2026, 1:12 AM
Reserved
Feb 16, 2026, 12:00 AM
Status
Analyzed
Published
Mar 25, 2026, 4:16 PM
Modified
Jun 17, 2026, 10:26 AM