CVE-2024-44337: Github.com/gomarkdown/markdown Infinite Loop Vulnerability

MODERATE
Advisory Identifier: GHSA-xhr3-wf7j-h255
CVSS 5.1
CWE-835
Published
Advisory Summary

CVE-2024-44337 is a MODERATE (CVSS 5.1) infinite loop vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Github.com/gomarkdown/markdown libraries in the Go ecosystem. The issue involves infinite loop in github.com/gomarkdown/markdown. Remediation is available by upgrading affected packages to version 0.0.0-20240729212818-a2a9c4f76ef5.

CVE-2024-44337 at a Glance

CVE Identifier CVE-2024-44337
GHSA Identifier GHSA-xhr3-wf7j-h255
Severity MODERATE
CVSS v3.1 Base Score 5.1
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Github.com/gomarkdown/markdown
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.1

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

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

How to Fix CVE-2024-44337

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

github.com/gomarkdown/markdown fixed: 0.0.0-20240729212818-a2a9c4f76ef5
Upgrade github.com/gomarkdown/markdown to 0.0.0-20240729212818-a2a9c4f76ef5
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 github.com/gomarkdown/markdown

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-44337, inspect your project dependencies for Github.com/gomarkdown/markdown:

inspect dependencies for github.com/gomarkdown/markdown

Analyze the terminal output to locate any version of Github.com/gomarkdown/markdown in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20240729212818-a2a9c4f76ef5), 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 Github.com/gomarkdown/markdown, 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

The package `github.com/gomarkdown/markdown` is a Go library for parsing Markdown text and rendering as HTML. Prior to pseudoversion `v0.0.0-20240729232818-a2a9c4f`, which corresponds with commit `a2a9c4f76ef5a5c32108e36f7c47f8d310322252`, there was a logical problem in the paragraph function of the parser/block.go file, which allowed a remote attacker to cause a denial of service (DoS) condition by providing a tailor-made input that caused an infinite loop, causing the program to hang and consume resources indefinitely. Submit `a2a9c4f76ef5a5c32108e36f7c47f8d310322252` contains fixes to this problem.

CVE-2024-44337 Affected Github.com/gomarkdown/markdown Versions

1 component(s)
Fixed Versions:
0.0.0-20240729212818-a2a9c4f76ef5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gomarkdown/markdown
Go
< 0.0.0-20240729212818-a2a9c4f76ef5
0.0.0-20240729212818-a2a9c4f76ef5

References

Frequently Asked Questions

What is CVE-2024-44337?
CVE-2024-44337 is a security vulnerability in Github.com/gomarkdown/markdown involving Infinite loop in github.com/gomarkdown/markdown under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Github.com/gomarkdown/markdown versions are affected?
Affected versions include releases prior to 0.0.0-20240729212818-a2a9c4f76ef5 across affected packages: github.com/gomarkdown/markdown.
What version fixes CVE-2024-44337?
Upgrading to 0.0.0-20240729212818-a2a9c4f76ef5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gomarkdown/markdown affected?
Yes, github.com/gomarkdown/markdown is affected in releases prior to 0.0.0-20240729212818-a2a9c4f76ef5. Upgrade your dependency to 0.0.0-20240729212818-a2a9c4f76ef5 or later.
What is the CVSS score of CVE-2024-44337?
CVE-2024-44337 has a CVSS v3.1 base score of 5.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2024-44337?
CVE-2024-44337 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 Go dependencies for CVE-2024-44337?
Run the dependency tree command: 'inspect dependencies for github.com/gomarkdown/markdown'. 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-xhr3-wf7j-h255",
  "modified" : "2024-12-12T17:59:12Z",
  "published" : "2024-10-15T21:30:39Z",
  "aliases" : [ "CVE-2024-44337" ],
  "summary" : "Infinite loop in github.com/gomarkdown/markdown",
  "details" : "The package `github.com/gomarkdown/markdown` is a Go library for parsing Markdown text and rendering as HTML. Prior to pseudoversion `v0.0.0-20240729232818-a2a9c4f`, which corresponds with commit `a2a9c4f76ef5a5c32108e36f7c47f8d310322252`, there was a logical problem in the paragraph function of the parser/block.go file, which allowed a remote attacker to cause a denial of service (DoS) condition by providing a tailor-made input that caused an infinite loop, causing the program to hang and consume resources indefinitely. Submit `a2a9c4f76ef5a5c32108e36f7c47f8d310322252` contains fixes to this problem.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gomarkdown/markdown"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20240729212818-a2a9c4f76ef5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-44337"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gomarkdown/markdown/commit/a2a9c4f76ef5a5c32108e36f7c47f8d310322252"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Brinmon/CVE-2024-44337"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gomarkdown/markdown"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2024-3205"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-16T14:09:50Z",
    "nvd_published_at" : "2024-10-15T20:15:21Z"
  }
}