# GHSA-636f-xm5j-pj9m: Several quadratic complexity bugs may lead to denial of service in Commonmarker

> Quadratic complexity bugs in the Commonmarker library allow attackers to cause denial of service via resource exhaustion.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 24 Jan 2023

## What is GHSA-636f-xm5j-pj9m?

GHSA-636f-xm5j-pj9m is a denial of service vulnerability in commonmarker, published on 24 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

## Impact

Several quadratic complexity bugs in commonmarker's underlying [`cmark-gfm`](https://github.com/github/cmark-gfm) library may lead to unbounded resource exhaustion and subsequent denial of service.

The following vulnerabilities were addressed:

* [CVE-2023-22483](https://github.com/github/cmark-gfm/security/advisories/GHSA-29g3-96g3-jg6c)
* [CVE-2023-22484](https://github.com/github/cmark-gfm/security/advisories/GHSA-24f7-9frr-5h2r)
* [CVE-2023-22485](https://github.com/github/cmark-gfm/security/advisories/GHSA-c944-cv5f-hpvr)
* [CVE-2023-22486](https://github.com/github/cmark-gfm/security/advisories/GHSA-r572-jvj2-3m8p)

For more information, consult the release notes for version [`0.23.0.gfm.7`](https://github.com/github/cmark-gfm/releases/tag/0.29.0.gfm.7).

## Mitigation

Users are advised to upgrade to commonmarker version [`0.23.7`](https://rubygems.org/gems/commonmarker/versions/0.23.7).

## Which versions are affected by GHSA-636f-xm5j-pj9m?

2 open source packages ship an affected version, including commonmarker.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `commonmarker` | RubyGems | All versions | 0.23.7 |
| `commonmarker` | RubyGems | All versions | 0.23.7 |

## How do I fix GHSA-636f-xm5j-pj9m?

Upgrade commonmarker to 0.23.7 or later.

## Is GHSA-636f-xm5j-pj9m being exploited?

There is no known exploitation of GHSA-636f-xm5j-pj9m in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-636f-xm5j-pj9m and fix it if it is affected.

What it is: GHSA-636f-xm5j-pj9m is a denial of service vulnerability in commonmarker, published on 24 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-636f-xm5j-pj9m in the wild and no public exploit code.

Affected packages and fixed versions:
- commonmarker (RubyGems): affected all versions; fixed in 0.23.7
- commonmarker (RubyGems): affected all versions; fixed in 0.23.7

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/GHSA-636f-xm5j-pj9m/ (Markdown: https://insights.sbomify.com/GHSA-636f-xm5j-pj9m/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-636f-xm5j-pj9m

---
From sbomify Insights: https://insights.sbomify.com/GHSA-636f-xm5j-pj9m/
Summaries are generated and may contain mistakes; the official description above is the record.
