node-tesseract-ocr is vulnerable to OS Command Injection through unsanitized recognize() function parameter
Critical severity
GitHub Reviewed
Published
Mar 25, 2026
to the GitHub Advisory Database
•
Updated Mar 27, 2026
Description
Published by the National Vulnerability Database
Mar 25, 2026
Published to the GitHub Advisory Database
Mar 25, 2026
Reviewed
Mar 27, 2026
Last updated
Mar 27, 2026
node-tesseract-ocr is an npm package that provides a Node.js wrapper for Tesseract OCR. In all versions through 2.2.1, the recognize() function in src/index.js is vulnerable to OS Command Injection. The file path parameter is concatenated into a shell command string and passed to child_process.exec() without proper sanitization
References