Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS12MjIyLTZtcjQtcWoyOc03aw

Command Injection vulnerability in asciidoctor-include-ext

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.

Permalink: https://github.com/advisories/GHSA-v222-6mr4-qj29
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS12MjIyLTZtcjQtcWoyOc03aw
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: about 2 years ago
Updated: about 1 year ago


CVSS Score: 10.0
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Identifiers: GHSA-v222-6mr4-qj29, CVE-2022-24803
References: Repository: https://github.com/jirutka/asciidoctor-include-ext
Blast Radius: 28.7

Affected Packages

rubygems:asciidoctor-include-ext
Dependent packages: 3
Dependent repositories: 740
Downloads: 20,569,819 total
Affected Version Ranges: < 0.4.0
Fixed in: 0.4.0
All affected versions: 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.3.1
All unaffected versions: 0.4.0