/

CVE-2026-110638

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in doc-recog PDF Reader

CVE-2026-110638

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical OS command injection vulnerability in doc-recog allows crafted document paths supplied to recog() or tag() to be interpreted as shell commands.

When the affected PDF-reading flow passes a path to a shell-based pdftotext execution call, an attacker may execute commands with the privileges of the Node.js process.

A critical OS command injection vulnerability in doc-recog allows crafted document paths supplied to recog() or tag() to be interpreted as shell commands.

When the affected PDF-reading flow passes a path to a shell-based pdftotext execution call, an attacker may execute commands with the privileges of the Node.js process.

Affected context

The vulnerability affects doc-recog deployments through version 1.1.6 when document paths from an attacker-influenced source reach the recog() or tag() APIs. Risk exists where DocData._readPDF invokes pdftotext through a shell without adequately separating data from command arguments or restricting path contents.

The vulnerability affects doc-recog deployments through version 1.1.6 when document paths from an attacker-influenced source reach the recog() or tag() APIs. Risk exists where DocData._readPDF invokes pdftotext through a shell without adequately separating data from command arguments or restricting path contents.

Exploit preconditions

  • Attack surface: Applications exposing document-recognition functionality through recog() or tag()
  • Required access: Ability to supply or influence a document path processed by the application
  • Trigger point: PDF text extraction in DocData._readPDF
  • Why exploitation is possible: The supplied path is incorporated into a shell-based command, allowing shell metacharacters and command-substitution syntax to be interpreted rather than treated strictly as file-name data
  • Attack surface: Applications exposing document-recognition functionality through recog() or tag()
  • Required access: Ability to supply or influence a document path processed by the application
  • Trigger point: PDF text extraction in DocData._readPDF
  • Why exploitation is possible: The supplied path is incorporated into a shell-based command, allowing shell metacharacters and command-substitution syntax to be interpreted rather than treated strictly as file-name data

Why this happens

The underlying bug is OS command injection caused by passing attacker-influenced file-path data into a shell command without enforcing a strict separation between arguments and executable logic.

This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command. The insecure pattern occurs when a process-spawning API invokes a shell and concatenates or interpolates untrusted input into the command string.

The underlying bug is OS command injection caused by passing attacker-influenced file-path data into a shell command without enforcing a strict separation between arguments and executable logic.

This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command. The insecure pattern occurs when a process-spawning API invokes a shell and concatenates or interpolates untrusted input into the command string.

Potential impact

  • Attackers may execute arbitrary operating-system commands
  • The Node.js application process and its accessible data may be compromised
  • Sensitive files, credentials, or environment variables could be disclosed
  • The host or container could be altered or used for lateral movement
  • Service availability and application integrity may be affected
  • Attackers may execute arbitrary operating-system commands
  • The Node.js application process and its accessible data may be compromised
  • Sensitive files, credentials, or environment variables could be disclosed
  • The host or container could be altered or used for lateral movement
  • Service availability and application integrity may be affected

General mitigation guidance

Mitigation generally focuses on ensuring that document paths remain data rather than executable shell content.

Common defensive patterns include:

  • Using direct process-spawning APIs that pass executable arguments separately and do not invoke a shell
  • Applying strict path validation, canonicalization, and allowlisting before file access
  • Restricting accepted inputs to expected file locations and permitted document types
  • Avoiding string concatenation when constructing operating-system commands
  • Running the Node.js service with the minimum filesystem, network, and process privileges required
  • Isolating document-processing workers and applying read-only or sandboxed execution controls where practical

Mitigation generally focuses on ensuring that document paths remain data rather than executable shell content.

Common defensive patterns include:

  • Using direct process-spawning APIs that pass executable arguments separately and do not invoke a shell
  • Applying strict path validation, canonicalization, and allowlisting before file access
  • Restricting accepted inputs to expected file locations and permitted document types
  • Avoiding string concatenation when constructing operating-system commands
  • Running the Node.js service with the minimum filesystem, network, and process privileges required
  • Isolating document-processing workers and applying read-only or sandboxed execution controls where practical

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules for shell-enabled process execution and string interpolation involving user-controlled paths
  • Code review checks for command construction through concatenation, templates, or shell wrappers
  • Runtime monitoring for unexpected child processes, unusual command-line arguments, or document-processing processes accessing unrelated files
  • Policy enforcement that requires non-shell process APIs and approved path-validation utilities
  • Automated security scanning and dependency review to identify command-injection patterns in document-processing code

Detection approaches can include:

  • Static analysis rules for shell-enabled process execution and string interpolation involving user-controlled paths
  • Code review checks for command construction through concatenation, templates, or shell wrappers
  • Runtime monitoring for unexpected child processes, unusual command-line arguments, or document-processing processes accessing unrelated files
  • Policy enforcement that requires non-shell process APIs and approved path-validation utilities
  • Automated security scanning and dependency review to identify command-injection patterns in document-processing code

Sources

SourceLink
github.comgithub.com/zepspaiva/doc-recog
github.comgithub.com/zepspaiva/doc-recog/blob/96d31957fbc2a31f1d739e2d64e5c85a05f688ec/docdata.js#L69-L74
github.comgithub.com/zepspaiva/doc-recog/pull/2
vulncheck.comvulncheck.com/advisories/doc-recog-through-1.1.6-os-command-injection-via-docdata-readpdf-file-path

Frequently asked

questions

It can be remotely exploitable when an application exposes document-recognition functionality and accepts document paths or path-bearing input from an untrusted remote user.

The attacker needs a way to influence a path that reaches recog() or tag() and is subsequently processed by the PDF-reading workflow. The exact access requirement depends on how the host application exposes those APIs.

The safest pattern is to avoid shell invocation entirely, pass executable arguments through a direct process API, and validate and constrain paths before invoking PDF conversion.

Treat file paths as untrusted input, use allowlisted locations and formats, enforce least privilege, isolate document-processing workloads, and review all operating-system process execution boundaries.

It can be remotely exploitable when an application exposes document-recognition functionality and accepts document paths or path-bearing input from an untrusted remote user.

The attacker needs a way to influence a path that reaches recog() or tag() and is subsequently processed by the PDF-reading workflow. The exact access requirement depends on how the host application exposes those APIs.

The safest pattern is to avoid shell invocation entirely, pass executable arguments through a direct process API, and validate and constrain paths before invoking PDF conversion.

Treat file paths as untrusted input, use allowlisted locations and formats, enforce least privilege, isolate document-processing workloads, and review all operating-system process execution boundaries.

Find out what's already
exploitable in your codebase.