Skip to content

Command Injection vulnerability in asciidoctor-include-ext

Critical severity GitHub Reviewed Published Mar 31, 2022 in jirutka/asciidoctor-include-ext • Updated May 4, 2023

Package

bundler asciidoctor-include-ext (RubyGems)

Affected versions

< 0.4.0

Patched versions

0.4.0

Description

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.

References

@jirutka jirutka published to jirutka/asciidoctor-include-ext Mar 31, 2022
Published to the GitHub Advisory Database Mar 31, 2022
Reviewed Mar 31, 2022
Published by the National Vulnerability Database Apr 1, 2022
Last updated May 4, 2023

Severity

Critical
10.0
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Weaknesses

CVE ID

CVE-2022-24803

GHSA ID

GHSA-v222-6mr4-qj29

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.