GHSA-v222-6mr4-qj29

Suggest an improvement
Source
https://github.com/advisories/GHSA-v222-6mr4-qj29
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/03/GHSA-v222-6mr4-qj29/GHSA-v222-6mr4-qj29.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-v222-6mr4-qj29
Aliases
Published
2022-03-31T23:27:15Z
Modified
2023-11-01T04:58:09.469480Z
Severity
  • 10.0 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H CVSS Calculator
Summary
Command Injection vulnerability in asciidoctor-include-ext
Details

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

  • https://sakurity.com/blog/2015/02/28/openuri.html

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.

Database specific
{
    "nvd_published_at": "2022-04-01T00:15:00Z",
    "cwe_ids": [
        "CWE-78"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2022-03-31T23:27:15Z"
}
References

Affected packages

RubyGems / asciidoctor-include-ext

Package

Name
asciidoctor-include-ext
Purl
pkg:gem/asciidoctor-include-ext

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.4.0

Affected versions

0.*

0.1.0
0.1.1
0.2.0
0.3.0
0.3.1