{"id":"CVE-2022-24803","aliases":["GHSA-v222-6mr4-qj29"],"url":"https://o3.security/vulnerability/CVE-2022-24803","summary":"Command Injection vulnerability in asciidoctor-include-ext","details":"### Impact\n\nApplications using [Asciidoctor (Ruby)](https://github.com/asciidoctor/asciidoctor) with [asciidoctor-include-ext](https://github.com/jirutka/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)\n\n\n### Patches\n\nThe vulnerability has been fixed in commit c7ea001 (and further improved in cbaccf3), which is included in version [0.4.0](https://rubygems.org/gems/asciidoctor-include-ext/versions/0.4.0).\n\n### Workarounds\n\n```rb\nrequire 'asciidoctor/include_ext'\n\nclass Asciidoctor::IncludeExt::IncludeProcessor\n  # Overrides superclass private method to mitigate Command Injection\n  # vulnerability in asciidoctor-include-ext <0.4.0.\n  def target_uri?(target)\n    target.downcase.start_with?('http://', 'https://') \\\n      && URI.parse(target).is_a?(URI::HTTP)\n  rescue URI::InvalidURIError\n    false\n  end\nend\n```\n\n### References\n\n* https://sakurity.com/blog/2015/02/28/openuri.html\n\n### Credits\n\nThis vulnerability was discovered by Joern Schneeweisz from the GitLab Security Research Team.\n\n\n### For more information\n\nSee commit message c7ea001.\n\nIf you have any questions or comments about this advisory open an issue in [jirutka/asciidoctor-include-ext](https://github.com/jirutka/asciidoctor-include-ext/issues/).","published":"2022-03-31T23:30:14Z","modified":"2026-08-12T03:51:28.116060783Z","cvss":{"score":10,"severity":"CRITICAL","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":1,"affectedPackages":[{"ecosystem":"RubyGems","name":"asciidoctor-include-ext","fixedVersion":"0.4.0"}],"fix":{"url":"https://github.com/jirutka/asciidoctor-include-ext/commit/c7ea001a597c7033575342c51483dab7b87ae155","label":"jirutka/asciidoctor-include-ext@c7ea001"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/24xxx/CVE-2022-24803.json"},{"type":"ADVISORY","url":"https://github.com/jirutka/asciidoctor-include-ext/security/advisories/GHSA-v222-6mr4-qj29"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24803"},{"type":"FIX","url":"https://github.com/jirutka/asciidoctor-include-ext/commit/c7ea001a597c7033575342c51483dab7b87ae155"},{"type":"FIX","url":"https://github.com/jirutka/asciidoctor-include-ext/commit/cbaccf3de533cbca224bf61d0b74e4b84d41d8ee"},{"type":"PACKAGE","url":"https://github.com/jirutka/asciidoctor-include-ext"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/asciidoctor-include-ext/CVE-2022-24803.yml"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:28.116060783Z"}}