{"id":"CVE-2024-34075","aliases":["EUVD-2024-1647","GHSA-hfrv-h3q8-9jpr"],"status":"published","title":"kurwov vulnerable to Denial of Service due to improper data sanitization","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.","severity":{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00299,"percentile":0.22859,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-502"],"published":"2024-05-03T17:51:30Z","modified":"2026-10-28T02:30:57Z","fixes":[{"ecosystem":"npm","package":"kurwov","fixed_in":["3.2.5"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"kurwov","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.1.0"},{"fixed":"3.2.5"}]}]},{"source":"osv","ecosystem":"npm","package":"kurwov","ranges":[{"type":"SEMVER","events":[{"introduced":"3.1.0"},{"fixed":"3.2.5"}]}]}],"products":[{"vendor":"xiboon","product":"kurwov"}],"references":[{"url":"https://github.com/xiboon/kurwov/security/advisories/GHSA-hfrv-h3q8-9jpr","tags":["x_refsource_CONFIRM","x_transferred","advisory","web"]},{"url":"https://github.com/xiboon/kurwov/commit/85d63e652594f121d6656177d7a3c0d823c976c9","tags":["x_refsource_MISC","x_transferred","fix","web"]},{"url":"https://github.com/xiboon/kurwov/blob/0d58dfa42135ab40e830e92622857282f980ca89/src/MarkovData.ts#L38-L44","tags":["x_refsource_MISC","x_transferred","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34075","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-hfrv-h3q8-9jpr"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/34xxx/CVE-2024-34075.json","tags":["advisory"]},{"url":"https://github.com/xiboon/kurwov","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-34075","title":"kurwov vulnerable to Denial of Service due to improper data sanitization","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.","status":"published","published":"2024-05-03T17:51:30.966Z","modified":"2024-08-02T02:42:59.964Z","cvss":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:34:23.193864Z"}],"euvd":[{"id":"EUVD-2024-1647","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.","status":"published","published":"2024-05-03T17:51:30Z","modified":"2024-08-02T02:42:59Z","cvss":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-03T03:50:21.908049Z"}],"ghsa":[{"id":"GHSA-hfrv-h3q8-9jpr","title":"kurwov vulnerable to Denial of Service due to improper data sanitization","description":"### Summary\nAn 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.\n\n### Details\nhttps://github.com/xiboon/kurwov/blob/0d58dfa42135ab40e830e92622857282f980ca89/src/MarkovData.ts#L38-L44\n\nIf a string contains a forbidden substring (i.e. `__proto__`) followed by a space character, the second line 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).\n\n`data` is then defined as the special function found in its prototype instead of an array.\n\nOn the last line, `data` is then indexed by a random number, which is supposed to return a string but returns undefined as it's a function. Calling `endsWith` then throws.\n\n### PoC\nhttps://runkit.com/embed/m6uu40r5ja9b\n\n### Impact\nAny dataset can be contaminated with the substring making it unable to properly generate anything in some cases.","status":"published","published":"2024-05-03T20:30:38Z","modified":"2024-05-03T20:30:39Z","cvss":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:37:48.08826Z"}],"nvd":[{"id":"CVE-2024-34075","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.","status":"published","published":"2024-05-03T18:15:09.97Z","modified":"2026-06-17T07:32:51.543Z","cvss":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"secondary"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:09:56.122111Z"}],"osv":[{"id":"CVE-2024-34075","title":"kurwov vulnerable to Denial of Service due to improper data sanitization","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.","status":"published","published":"2024-05-03T17:51:30.966Z","modified":"2026-10-28T02:30:57.491029427Z","cvss":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T15:44:40.391953Z"},{"id":"GHSA-hfrv-h3q8-9jpr","title":"kurwov vulnerable to Denial of Service due to improper data sanitization","description":"### Summary\nAn 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.\n\n### Details\nhttps://github.com/xiboon/kurwov/blob/0d58dfa42135ab40e830e92622857282f980ca89/src/MarkovData.ts#L38-L44\n\nIf a string contains a forbidden substring (i.e. `__proto__`) followed by a space character, the second line 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).\n\n`data` is then defined as the special function found in its prototype instead of an array.\n\nOn the last line, `data` is then indexed by a random number, which is supposed to return a string but returns undefined as it's a function. Calling `endsWith` then throws.\n\n### PoC\nhttps://runkit.com/embed/m6uu40r5ja9b\n\n### Impact\nAny dataset can be contaminated with the substring making it unable to properly generate anything in some cases.","status":"published","published":"2024-05-03T20:30:38Z","modified":"2026-09-10T03:50:00.430987236Z","cvss":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T15:46:48.920784Z"}]}}
