Impact
Unvalidated file paths supplied to the recognize() function in the node-tesseract-ocr npm package are concatenated into a shell command string and passed to child_process.exec() without sanitization, creating an OS Command Injection flaw (CWE‑78). An attacker who can influence the file path argument could inject arbitrary shell commands, potentially gaining full control over the host running the Node.js application.
Affected Systems
All releases of node‑tesseract‑ocr up to and including version 2.2.1 contain the vulnerable code. Any Node.js application that imports this package and calls recognize()—for example, web services or scripts that process user‑supplied image files—is affected. The issue resides in the src/index.js file of the package.
Risk and Exploitability
The CVSS score of 9.8 marks this vulnerability as critical. The attack vector is inferred to be user‑controlled input via the file path parameter; any interface that accepts a file path, such as a web API or CLI, provides a potential exploitation path. Although EPSS data is not available and the vulnerability is not yet listed in the CISA KEV catalog, the straightforward exploitability and severe impact suggest a high likelihood of real‑world exploitation.
OpenCVE Enrichment
Github GHSA