{"id":"CVE-2024-34075","aliases":["CVE-2024-34075","GHSA-hfrv-h3q8-9jpr"],"related":[],"kind":"vulnerability","state":"published","title":"kurwov vulnerable to Denial of Service due to improper data sanitization","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"kurwov es una librería rápida y libre de dependencias para crear cadenas de Markov. Una sanitización insegura del contenido del conjunto de datos en el método `MarkovData#getNext` usado en `Markov#generate` y `Markov#choose` permite que una cadena creada con fines malintencionados en el conjunto de datos lance y detenga la función para que no se ejecute correctamente. Si una cadena contiene una subcadena prohibida (es decir, `__proto__`) seguida de un carácter de espacio, el código accederá a una propiedad especial en `MarkovData#finalData` eliminando el último carácter de la cadena, evitando la desinfección del conjunto de datos (como se supone). ya debe estar desinfectado antes de llamar a esta función). Cualquier conjunto de datos puede estar contaminado con la subcadena, lo que hace que en algunos casos no pueda generar nada correctamente. Este problema se solucionó en la versión 3.2.5 y se recomienda a todos los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.","source":"nvd"}],"published":"2024-05-03T17:51:30.966Z","modified":"2026-09-10T03:50:00.430Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"rating":"MEDIUM"}],"cwes":["CWE-502"],"affected":[{"ranges":[{"version":">= 3.1.0, < 3.2.5","status":"affected"}],"vendor":"xiboon","product":"kurwov","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"3.1.0","lastAffected":"3.2.5","status":"affected"}],"vendor":"xiboon","product":"kurwov","cpe":"cpe:2.3:a:xiboon:kurwov:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"3.1.0","status":"affected","fixed":"3.2.5"}],"ecosystem":"npm","package":"kurwov","purl":"pkg:npm/kurwov","source":"ghsa"}],"references":[{"url":"https://github.com/xiboon/kurwov/security/advisories/GHSA-hfrv-h3q8-9jpr","tags":["web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/xiboon/kurwov/commit/85d63e652594f121d6656177d7a3c0d823c976c9","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/xiboon/kurwov/blob/0d58dfa42135ab40e830e92622857282f980ca89/src/MarkovData.ts#L38-L44","tags":["web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34075","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/xiboon/kurwov","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-05-03T20:04:26.343Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-34075","url":"https://www.cve.org/CVERecord?id=CVE-2024-34075","licence":"CVE Terms of Use","modified":"2024-08-02T02:42:59.964Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hfrv-h3q8-9jpr","url":"https://github.com/advisories/GHSA-hfrv-h3q8-9jpr","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:00.430Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-34075","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-34075","licence":"Public domain","modified":"2026-06-17T07:32:51.543Z"}],"updatedAt":"2026-11-25T22:58:39.937Z","epss":{"score":0.00299,"percentile":0.24328,"date":"2026-12-01T12:00:22.000Z"}}