# GHSA-xf5p-87ch-gxw2: Marked ReDoS due to email addresses being evaluated in quadratic time

> Attackers can cause resource exhaustion and crash the application by submitting specially crafted email addresses to the marked library.

- **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:** 5 Jun 2019

## What is GHSA-xf5p-87ch-gxw2?

GHSA-xf5p-87ch-gxw2 is a denial of service vulnerability in marked, published on 5 Jun 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Versions of `marked` from 0.3.14 until 0.6.2 are vulnerable to Regular Expression Denial of Service. Email addresses may be evaluated in quadratic time, allowing attackers to potentially crash the node process due to resource exhaustion.

## Recommendation

Upgrade to version 0.6.2 or later.

## Which versions are affected by GHSA-xf5p-87ch-gxw2?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `marked` | npm | From 0.3.14 | 0.6.2 |
| `marked` | npm | From 0.3.14 | 0.6.2 |

## How do I fix GHSA-xf5p-87ch-gxw2?

Upgrade marked to 0.6.2 or later.

## Is GHSA-xf5p-87ch-gxw2 being exploited?

There is no known exploitation of GHSA-xf5p-87ch-gxw2 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-xf5p-87ch-gxw2 and fix it if it is affected.

What it is: GHSA-xf5p-87ch-gxw2 is a denial of service vulnerability in marked, published on 5 Jun 2019. 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-xf5p-87ch-gxw2 in the wild and no public exploit code.

Affected packages and fixed versions:
- marked (npm): affected from 0.3.14; fixed in 0.6.2
- marked (npm): affected from 0.3.14; fixed in 0.6.2

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-xf5p-87ch-gxw2/ (Markdown: https://insights.sbomify.com/GHSA-xf5p-87ch-gxw2/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-xf5p-87ch-gxw2

---
From sbomify Insights: https://insights.sbomify.com/GHSA-xf5p-87ch-gxw2/
Summaries are generated and may contain mistakes; the official description above is the record.
