{"id":"CVE-2024-42475","aliases":["CVE-2024-42475"],"related":[],"kind":"vulnerability","state":"published","title":"OAuth library for nim allows insecure generation of state values by generateState - entropy too low and uses regular PRNG instead of CSPRNG","summary":"In the OAuth library for nim prior to version 0.11, the `state` values generated by the `generateState` function do not have sufficient entropy. These can be successfully guessed by an attacker allowing them to perform a CSRF vs a user, associating the user's session with the attacker's protected resources. While `state` isn't exactly a cryptographic value, it should be generated in a cryptographically secure way. `generateState` should be using a CSPRNG. Version 0.11 modifies the `generateState` function to generate `state` values of at least 128 bits of entropy while using a CSPRNG.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the OAuth library for nim prior to version 0.11, the `state` values generated by the `generateState` function do not have sufficient entropy. These can be successfully guessed by an attacker allowing them to perform a CSRF vs a user, associating the user's session with the attacker's protected resources. While `state` isn't exactly a cryptographic value, it should be generated in a cryptographically secure way. `generateState` should be using a CSPRNG. Version 0.11 modifies the `generateState` function to generate `state` values of at least 128 bits of entropy while using a CSPRNG.","source":"cvelist"},{"lang":"es","text":"En la librería OAuth para nim anterior a la versión 0.11, los valores de \"state\" generados por la función \"generateState\" no tienen suficiente entropía. Un atacante puede adivinarlos con éxito, permitiéndole realizar un CSRF frente a un usuario, asociando la sesión del usuario con los recursos protegidos del atacante. Si bien \"state\" no es exactamente un valor criptográfico, debe generarse de forma criptográficamente segura. `generateState` debería usar un CSPRNG. La versión 0.11 modifica la función \"generateState\" para generar valores de \"state\" de al menos 128 bits de entropía mientras se usa un CSPRNG.","source":"nvd"}],"published":"2024-08-15T18:40:49.750Z","modified":"2026-06-17T07:49:31.400Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-330","CWE-352"],"affected":[{"ranges":[{"version":"< 0.11","status":"affected"}],"vendor":"CORDEA","product":"oauth","source":"cvelist"}],"references":[{"url":"https://github.com/CORDEA/oauth/security/advisories/GHSA-332c-q46h-fg8f","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/CORDEA/oauth/blob/b8c163b0d9cfad6d29ce8c1fb394e5f47182ee1c/src/oauth2.nim#L179","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-08-19T19:19:16.514Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-42475","url":"https://www.cve.org/CVERecord?id=CVE-2024-42475","licence":"CVE Terms of Use","modified":"2024-08-19T19:23:56.720Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-42475","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42475","licence":"Public domain","modified":"2026-06-17T07:49:31.400Z"}],"updatedAt":"2026-11-25T22:58:44.422Z","epss":{"score":0.0025,"percentile":0.17573,"date":"2026-12-01T12:00:22.000Z"}}