# CVE-2024-44337: Infinite loop in github.com/gomarkdown/markdown

> A remote attacker can cause a denial of service via infinite loop in the Go markdown parser library by providing crafted input.

- **Severity:** Medium 5.1 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Oct 2024
- **Updated:** 14 Nov 2024
- **Also known as:** AZL-50618, DEBIAN-CVE-2024-44337, GHSA-xhr3-wf7j-h255, GO-2024-3205, UBUNTU-CVE-2024-44337, openSUSE-SU-2025:14753-1

## What is CVE-2024-44337?

CVE-2024-44337 is a medium-severity denial of service vulnerability in n/a, published on 15 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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.

## Which versions are affected by CVE-2024-44337?

3 open source packages ship an affected version, including github.com/gomarkdown/markdown.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/gomarkdown/markdown` | Go | All versions | 0.0.0-20240729212818-a2a9c4f76ef5 |
| `github.com/gomarkdown/markdown` | Go | All versions | 0.0.0-20240729212818-a2a9c4f76ef5 |
| `github.com/gomarkdown/markdown` | Go | All versions | 0.0.0-20240729212818-a2a9c4f76ef5 |
| `fq` | openSUSE:Tumbleweed | All versions | 0.14.0-1.1 |

## How do I fix CVE-2024-44337?

Upgrade github.com/gomarkdown/markdown to 0.0.0-20240729212818-a2a9c4f76ef5 or later.

## Is CVE-2024-44337 being exploited?

There is no known exploitation of CVE-2024-44337 in the wild and no public exploit code.

Public exploit code:

- CVE-2024-44337 POC  The package `github.com/gomarkdown/markdown` is a Go library for parsing Markdown text and rendering as HTML. 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. (github_poc): https://github.com/Brinmon/CVE-2024-44337

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-44337 and fix it if it is affected.

What it is: CVE-2024-44337 is a medium-severity denial of service vulnerability in n/a, published on 15 Oct 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-44337 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/gomarkdown/markdown (Go): affected all versions; fixed in 0.0.0-20240729212818-a2a9c4f76ef5
- github.com/gomarkdown/markdown (Go): affected all versions; fixed in 0.0.0-20240729212818-a2a9c4f76ef5
- github.com/gomarkdown/markdown (Go): affected all versions; fixed in 0.0.0-20240729212818-a2a9c4f76ef5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-44337/ (Markdown: https://insights.sbomify.com/CVE-2024-44337/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-44337
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-44337
- OSV: https://osv.dev/vulnerability/CVE-2024-44337

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-44337/
Summaries are generated and may contain mistakes; the official description above is the record.
