{"id":"CVE-2024-42475","summary":"OAuth library for nim allows insecure generation of state values by generateState - entropy too low and uses regular PRNG instead of CSPRNG","details":"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.","aliases":["GHSA-332c-q46h-fg8f"],"modified":"2026-08-12T03:51:45.580069446Z","published":"2024-08-15T18:40:49.750Z","database_specific":{"cwe_ids":["CWE-330","CWE-352"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42475.json","cna_assigner":"GitHub_M"},"references":[{"type":"WEB","url":"https://github.com/CORDEA/oauth/blob/b8c163b0d9cfad6d29ce8c1fb394e5f47182ee1c/src/oauth2.nim#L179"},{"type":"ADVISORY","url":"https://github.com/CORDEA/oauth/security/advisories/GHSA-332c-q46h-fg8f"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/42xxx/CVE-2024-42475.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-42475"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/cordea/oauth","events":[{"introduced":"0"},{"fixed":"ec2e058fc46f04deaf3cb55eca32b3b83c614953"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"fixed":"0.11"}],"source":"AFFECTED_FIELD"}}],"versions":["v0.10","v0.9","v0.8","v0.7","v0.6","v0.5","v0.4.1","v0.4","v0.3"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-42475.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"}]}