Vulnerabilities in pkg:gem/asciidoctor

PACKAGE
Advisory Identifier: GHSA-qc9p-mjxm-j2wj
Advisory Summary

CVE-2018-18385 is a HIGH (CVSS 7.5) asciidoctor infinite loop vulnerability vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Asciidoctor libraries in the RubyGems ecosystem. The issue involves asciidoctor infinite loop vulnerability. Remediation is available by upgrading affected packages to version 1.5.8.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/asciidoctor

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/asciidoctor. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-qc9p-mjxm-j2wj CVE-2018-18385 HIGH Asciidoctor Infinite Loop vulnerability

CVE-2018-18385 at a Glance

CVE Identifier CVE-2018-18385
GHSA Identifier GHSA-qc9p-mjxm-j2wj
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Asciidoctor
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2018-18385

To remediate this vulnerability, upgrade all affected Asciidoctor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

asciidoctor fixed: 1.5.8
Upgrade asciidoctor to 1.5.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for asciidoctor

How to Check if You Are Affected

To determine whether your application is affected by CVE-2018-18385, inspect your project dependencies for Asciidoctor:

inspect dependencies for asciidoctor

Analyze the terminal output to locate any version of Asciidoctor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.8), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Asciidoctor, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Asciidoctor in versions < 1.5.8 allows remote attackers to cause a denial of service (infinite loop). The loop was caused by the fact that `Parser.next_block` was not exhausting all the lines in the reader as the while loop expected it would. This was happening because the regular expression that detects any list was not agreeing with the regular expression that detects a specific list type. So the line kept getting pushed back onto the reader, hence causing the loop.

CVE-2018-18385 Affected Asciidoctor Versions

1 component(s)
Fixed Versions:
1.5.8
Product / Package Ecosystem Affected Versions Fixed Version
asciidoctor
RubyGems
< 1.5.8
1.5.8

References

Frequently Asked Questions

What is CVE-2018-18385?
CVE-2018-18385 is a security vulnerability in Asciidoctor involving Asciidoctor Infinite Loop vulnerability under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Asciidoctor versions are affected?
Affected versions include releases prior to 1.5.8 across affected packages: asciidoctor.
What version fixes CVE-2018-18385?
Upgrading to 1.5.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is asciidoctor affected?
Yes, asciidoctor is affected in releases prior to 1.5.8. Upgrade your dependency to 1.5.8 or later.
What is the CVSS score of CVE-2018-18385?
CVE-2018-18385 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2018-18385?
CVE-2018-18385 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check RubyGems dependencies for CVE-2018-18385?
Run the dependency tree command: 'inspect dependencies for asciidoctor'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qc9p-mjxm-j2wj",
  "modified" : "2023-01-24T18:32:26Z",
  "published" : "2022-05-13T01:50:40Z",
  "aliases" : [ "CVE-2018-18385" ],
  "summary" : "Asciidoctor Infinite Loop vulnerability",
  "details" : "Asciidoctor in versions < 1.5.8 allows remote attackers to cause a denial of service (infinite loop). The loop was caused by the fact that `Parser.next_block` was not exhausting all the lines in the reader as the while loop expected it would. This was happening because the regular expression that detects any list was not agreeing with the regular expression that detects a specific list type. So the line kept getting pushed back onto the reader, hence causing the loop.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "asciidoctor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-18385"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/asciidoctor/asciidoctor/issues/2888"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/asciidoctor/asciidoctor"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/asciidoctor/CVE-2018-18385.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-24T18:32:26Z",
    "nvd_published_at" : "2018-10-16T16:50:00Z"
  }
}