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
Published: 2026-03-25
Score: 9.8 Critical
EPSS: 3.6% Low
KEV: No
Impact: Remote Code Execution
Action: Apply patch
AI Analysis

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 4% 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.

Generated by OpenCVE AI on September 26, 2026 at 08:55 UTC.

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 September 26, 2026 at 08:55 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

Sat, 26 Sep 2026 09:15:00 +0000

Type Values Removed Values Added
Title OS Command Injection via File Path in textract

Thu, 18 Jun 2026 16:45:00 +0000

Type Values Removed Values Added
Title OS Command Injection via File Path in textract

Wed, 17 Jun 2026 09:15:00 +0000

Type Values Removed Values Added
Title OS Command Injection via Unsanitized File Path in textract

Tue, 16 Jun 2026 11:15:00 +0000

Type Values Removed Values Added
Title OS Command Injection via Unsanitized File Path in textract

Tue, 31 Mar 2026 03:00:00 +0000

Type Values Removed Values Added
Title OS Command Injection in textract via Untrusted File Names

Mon, 30 Mar 2026 13:45:00 +0000

Type Values Removed Values Added
Weaknesses CWE-78
CPEs cpe:2.3:a:dbashford:textract:*:*:*:*:*:node.js:*:*

Sun, 29 Mar 2026 20:45:00 +0000

Type Values Removed Values Added
Title OS Command Injection in textract via Untrusted File Names

Sat, 28 Mar 2026 03:15:00 +0000

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'}


Fri, 27 Mar 2026 20:30:00 +0000

Type Values Removed Values Added
Title OS Command Injection in textract via unsanitized file path
Weaknesses CWE-78

Fri, 27 Mar 2026 09:30:00 +0000

Type Values Removed Values Added
Title OS Command Injection in textract via unsanitized file path
Weaknesses CWE-78

Thu, 26 Mar 2026 12:30:00 +0000

Type Values Removed Values Added
Title OS Command Injection via Malicious File Paths in textract Package
Weaknesses CWE-20
CWE-78

Thu, 26 Mar 2026 12:00:00 +0000

Type Values Removed Values Added
First Time appeared Dbashford
Dbashford textract
Vendors & Products Dbashford
Dbashford textract

Wed, 25 Mar 2026 22:00:00 +0000

Type Values Removed Values Added
Title OS Command Injection via Malicious File Paths in textract Package
Weaknesses CWE-20
CWE-78

Wed, 25 Mar 2026 16:15:00 +0000

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

Subscriptions

Dbashford Textract
cve-icon MITRE

Status: PUBLISHED

Assigner: mitre

Published:

Updated: 2026-03-28T01:12:59.787Z

Reserved: 2026-02-16T00:00:00.000Z

Link: CVE-2026-26831

cve-icon Vulnrichment

Updated: 2026-03-28T01:12:42.439Z

cve-icon NVD

Status : Analyzed

Published: 2026-03-25T16:16:21.123

Modified: 2026-06-17T10:26:21.513

Link: CVE-2026-26831

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-26T09:00:14Z

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')