Horizon Alert
Summary of the vulnerability and why it matters
A security issue has been identified in a document recognition library that could allow attackers to execute commands on the system by manipulating document file paths. This vulnerability affects how certain documents are processed, potentially leading to unauthorized command execution with the privileges of the Node.js process. The main concern is to confirm if this specific library is in use and exposed to risk.
- Allows commands through crafted document paths.
- Leadership should remember this for potential exposure.
- Confirm relevance and exposure within our environment.
Attack Path
How an attacker could exploit the issue
An attacker can exploit this vulnerability by sending a specially crafted document path to an application that uses the doc-recog library. This path can contain commands that are executed by the underlying system. This could lead to the execution of arbitrary commands with the privileges of the Node.js process.
- Network access to the vulnerable application is required.
- Crafted document paths submitted to `recog()` or `tag()` functions.
- Arbitrary command execution with Node.js process privileges.
Live Threat
Current exploitation, exposure, and threat context
A remote attacker could execute arbitrary operating system commands on systems running doc-recog through 1.1.6 when processing specially crafted document paths. This could occur when the `recog()` or `tag()` functions receive a document path that contains shell command substitution. The Node.js process running doc-recog would execute these commands with its own privileges.
- Node.js process command execution.
- Crafted document paths are supplied.
- Arbitrary OS commands could run.
Operational Fix
Recommended remediation, mitigation, and detection steps
This OS command injection vulnerability in `doc-recog` impacts applications processing documents, particularly via the `readPDF` function. Ownership likely resides with the application development team or platform team responsible for the Node.js environment, with initial steps involving inventorying affected systems, assessing business criticality and external reachability, identifying the accountable owner, and then planning remediation based on risk.
- Application or platform teams should own.
- Verify external reachability and critical systems.
- Plan remediation based on identified risk.