Skip to main content

CVE-2022-24803: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in jirutka asciidoctor-include-ext

Medium
Published: Thu Mar 31 2022 (03/31/2022, 23:30:14 UTC)
Source: CVE
Vendor/Project: jirutka
Product: asciidoctor-include-ext

Description

Asciidoctor-include-ext is Asciidoctor’s standard include processor reimplemented as an extension. Versions prior to 0.4.0, when used to render user-supplied input in AsciiDoc markup, may allow an attacker to execute arbitrary system commands on the host operating system. This attack is possible even when `allow-uri-read` is disabled! The problem has been patched in the referenced commits.

AI-Powered Analysis

AILast updated: 06/22/2025, 02:36:43 UTC

Technical Analysis

CVE-2022-24803 is a security vulnerability classified under CWE-78, which pertains to improper neutralization of special elements used in OS commands, commonly known as OS Command Injection. This vulnerability affects the 'asciidoctor-include-ext' extension, a reimplementation of Asciidoctor's standard include processor. Versions of asciidoctor-include-ext prior to 0.4.0 are vulnerable when rendering user-supplied input in AsciiDoc markup. The core issue arises from insufficient sanitization or neutralization of input that is incorporated into system commands, allowing an attacker to inject and execute arbitrary commands on the host operating system. Notably, this vulnerability can be exploited even when the 'allow-uri-read' option is disabled, which is typically a security control to restrict external resource inclusion. The vulnerability was publicly disclosed on March 31, 2022, and has been patched in versions 0.4.0 and later. There are no known exploits in the wild reported to date. The vulnerability is significant because asciidoctor-include-ext is used in environments that process AsciiDoc documents, which may include automated documentation pipelines, continuous integration systems, and developer tools. If an attacker can supply malicious AsciiDoc content that is processed by a vulnerable version of this extension, they may achieve arbitrary code execution on the host system, potentially leading to full system compromise depending on the privileges of the process running the extension.

Potential Impact

For European organizations, the impact of this vulnerability can be substantial, particularly for those relying on AsciiDoc-based documentation workflows integrated into automated build or deployment pipelines. Successful exploitation could lead to unauthorized command execution, resulting in data breaches, system downtime, or lateral movement within the network. Confidentiality could be compromised if sensitive information is accessed or exfiltrated. Integrity could be undermined by unauthorized modification of files or configurations. Availability could be affected if destructive commands are executed. Organizations in sectors with stringent compliance requirements, such as finance, healthcare, and government, may face regulatory and reputational damage if exploited. The fact that exploitation does not require 'allow-uri-read' to be enabled broadens the attack surface, increasing risk. However, the absence of known exploits in the wild and the medium severity rating suggest that, while serious, the vulnerability may require specific conditions to be exploited effectively, such as the ability to supply or influence AsciiDoc content processed by the vulnerable extension.

Mitigation Recommendations

1. Upgrade: Immediately upgrade asciidoctor-include-ext to version 0.4.0 or later where the vulnerability is patched. 2. Input Validation: Implement strict validation and sanitization of all user-supplied AsciiDoc content before processing, ensuring that no untrusted input can be interpreted as system commands. 3. Least Privilege: Run processes that handle AsciiDoc rendering with the minimal necessary privileges to limit the impact of potential command execution. 4. Environment Isolation: Use containerization or sandboxing techniques to isolate the AsciiDoc processing environment, reducing the risk of system-wide compromise. 5. Monitoring and Logging: Enable detailed logging of AsciiDoc processing activities and monitor for unusual command execution patterns or errors indicative of exploitation attempts. 6. Access Controls: Restrict who can submit or modify AsciiDoc content in automated pipelines or documentation systems to trusted users only. 7. Disable Unnecessary Features: Although 'allow-uri-read' is not a mitigating factor here, ensure other potentially risky features or extensions are disabled unless explicitly required. 8. Security Awareness: Educate developers and documentation teams about the risks of processing untrusted content and the importance of using updated libraries.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-02-10T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9848c4522896dcbf6362

Added to database: 5/21/2025, 9:09:28 AM

Last enriched: 6/22/2025, 2:36:43 AM

Last updated: 7/21/2025, 7:05:51 AM

Views: 5

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats