CVE-2022-24803
JSON

10.0critical

Command Injection vulnerability in asciidoctor-include-ext

Severity
10.0critical CVSS:3.1 by GitHub_M
Exploit likelihood
2.69% (higher than 86% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-v222-6mr4-qj29

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.

Affected

Product or packageVersionsReported by
jirutka asciidoctor-include-ext< 0.4.0CVE List
asciidoctor-include-ext (RubyGems)before 0.4.0GitHub Advisory Database
asciidoctor-include-ext_project asciidoctor-include-extbefore 0.4.0NVD

All scores

GitHub_M10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
GitHub10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD10.0high CVSS:2.0AV:N/AC:L/Au:N/C:C/I:C/A:C

Classification

CWE-78

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

Applications using Asciidoctor (Ruby) with asciidoctor-include-ext (prior to version 0.4.0), which 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! (EDIT: it’s not)

Patches

The vulnerability has been fixed in commit c7ea001 (and further improved in cbaccf3), which is included in version 0.4.0.

Workarounds
require 'asciidoctor/include_ext'

class Asciidoctor::IncludeExt::IncludeProcessor
  # Overrides superclass private method to mitigate Command Injection
  # vulnerability in asciidoctor-include-ext <0.4.0.
  def target_uri?(target)
    target.downcase.start_with?('http://', 'https://') \
      && URI.parse(target).is_a?(URI::HTTP)
  rescue URI::InvalidURIError
    false
  end
end
References
Credits

This vulnerability was discovered by Joern Schneeweisz from the GitLab Security Research Team.

For more information

See commit message c7ea001.

If you have any questions or comments about this advisory open an issue in jirutka/asciidoctor-include-ext.

NVD (es)

Asciidoctor-include-ext es el procesador de inclusión estándar de Asciidoctor reimplementado como una extensión. En versiones anteriores a 0.4.0, cuando son usadas para renderizar la entrada suministrada por el usuario en el marcado AsciiDoc, pueden permitir a un atacante ejecutar comandos arbitrarios del sistema en el sistema operativo anfitrión. Este ataque es posible incluso cuando "allow-uri-read" está deshabilitado. El problema ha sido parcheado en los commits referenciados

References

Sources

SourceRecordLicence
CVE ListCVE-2022-24803 changed 2025-04-22CVE Terms of Use
GitHub Advisory DatabaseGHSA-v222-6mr4-qj29 changed 2023-11-08CC-BY-4.0
NVDCVE-2022-24803 changed 2026-06-17Public domain