# CVE-2026-121577: Unescaped header separators in whatstk build a regular expression that backtracks exponentially


- **Severity:** Medium 6.7 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Fix available:** No
- **Published:** 3 Nov 2026
- **Updated:** 6 Nov 2026
- **Also known as:** GHSA-g94x-jrvx-m3cv

## What is CVE-2026-121577?

CVE-2026-121577 is a medium-severity vulnerability in lucasrodes whatstk, published on 3 Nov 2026. 

### Official description

Inefficient Regular Expression Complexity (CWE-1333) in generate_regex() (whatstk/whatsapp/parser.py) in whatstk from 0.2.0 before 0.9.0 allows a party that supplies a chat export to consume the CPU of the process that parses it for an unbounded time, because the function builds the header regular expression by replacing each %x code with its named capture group and leaves every other character of the header format in the pattern unescaped. A header whose date separator is a regular expression metacharacter therefore alters the pattern instead of matching itself: a separator of + quantifies the preceding capture group, giving (?P<day>\d{1,2})+(?P<month>\d{1,2})+(?P<year>\d{2,4}), and a run of digits that cannot complete the header then makes the engine try every way of partitioning that run. Header auto detection is enabled by default and derives the format from the text of the file, so the separator is taken from the export itself and no header format has to be passed by the caller. Separators of (, ) and \ instead raise re.PatternError, separators of *, | and ? raise TypeError, and separators of ^ and $ raise KeyError, none of which the library catches. This results in the parse of a file of a few hundred bytes consuming CPU without completing, or in an uncaught exception in the calling program.

Weakness: CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2026-121577?


## How do I fix CVE-2026-121577?

No fix has been published for CVE-2026-121577 yet. Limit exposure of the affected software until one is available.

## Is CVE-2026-121577 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-121577 and fix it if it is affected.

What it is: CVE-2026-121577 is a medium-severity vulnerability in lucasrodes whatstk, published on 3 Nov 2026. 
Exploitation: There is no known exploitation of CVE-2026-121577 in the wild and no public exploit code.

Affected product: lucasrodes whatstk. No package-level version data is available, so check the vendor advisory linked from the reference page.

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-2026-121577/ (Markdown: https://insights.sbomify.com/CVE-2026-121577/index.md)
```

## Sources

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

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