External risk intelligence

Office-Converter OS Command Injection Vulnerability

CVE advisorySeverity: CRITICAL (CVSS 9.3)

CVE-2020-37282

The vulnerability exists in a library designed to convert documents, a function commonly exposed as a web service or API endpoint for file processing. Applications using this library often process user-supplied files, making them internet-facing in many common deployment scenarios where users upload documents for conversion or remote processing.

OS Command Injection

Halo Surface Signal: 4 out of 5 — likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

This advisory details a critical vulnerability in office-converter software related to OS command injection. The issue stems from how the software handles file names when converting documents, allowing attackers to execute commands on the underlying system by embedding malicious commands within the file name. This could potentially lead to unauthorized access and control over the affected Node.js environment.

  • A file name flaw allows unauthorized command execution.
  • Impacts systems processing documents via this converter.
  • Confirm relevance and exposure of this software.

Attack Path

How an attacker could exploit the issue

An attacker could exploit this by sending a specially crafted file name to a service that uses the office-converter library. This malicious file name, when processed by the `generatePdf()` or `generateHtml()` functions, would allow the attacker to execute arbitrary commands on the server, leveraging the underlying `unoconv` command.

  • Attacker needs to send a crafted file name.
  • Vulnerable function is `generatePdf()` or `generateHtml()`.
  • Risk is arbitrary command execution.

Live Threat

Current exploitation, exposure, and threat context

When supported by the advisory, an attacker could execute arbitrary commands on the system running the vulnerable application by supplying a malicious file name. This could allow them to perform actions with the privileges of the Node.js process.

  • System commands could be executed.
  • Malicious file names may be supplied.
  • Arbitrary command execution is possible.

Operational Fix

Recommended remediation, mitigation, and detection steps

The office-converter library's OS command injection vulnerability likely affects application owners responsible for integrating document conversion features. The first step is to identify all instances of this library, determine their exposure, and confirm business criticality. Subsequently, the accountable owner should be identified to plan remediation, which may involve vendor coordination or code updates.

  • Application owners should lead remediation efforts.
  • Verify affected services and exposure.
  • Plan updates or vendor coordination.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is the office-converter software?

office-converter is a Node.js library used by developers to automate document format conversions, such as turning various files into PDFs or HTML. It serves as a bridge to underlying tools like unoconv, which handle the heavy lifting of processing office documents. Many applications integrate this library to provide users with convenient file conversion features within web services or document management portals.

How does CVE-2020-37282 allow command injection?

This vulnerability, classified as CWE-78, occurs because the library does not properly sanitize file names before passing them to the system. When the software runs conversion functions, it takes the provided file name and injects it directly into a command string. If an attacker includes shell characters like backticks or $(...) in the name, the system mistakenly executes those characters as separate, unauthorized commands with the permissions of the Node.js process.

What triggers this vulnerability?

An attacker triggers this bug by providing a maliciously crafted file name to the generatePdf() or generateHtml() functions. The vulnerability requires the application to accept user-supplied input as a file name. Merely having the library installed in your codebase does not trigger the issue; the flaw is only activated when an application calls these specific functions using untrusted input provided by an external source.

Is my system at risk?

Halo Surface Signal indicates that because this library is often used in web services that accept user uploads for conversion, it is frequently internet-facing. If your application processes files uploaded by remote users or public-facing APIs, the risk is higher. You should assess whether your specific service passes external, unvalidated file names directly into the office-converter functions.

What should I do to secure my application?

Start by auditing your codebase to locate where the office-converter library is implemented. Once identified, determine if the application handles potentially untrusted file names within the generatePdf() or generateHtml() functions. Coordinate with your engineering or development team to evaluate the library's integration and plan for necessary code updates or secure configuration changes to mitigate this command injection path.

References