# CVE-2024-42475: OAuth library for nim allows insecure generation of state values by generateState - entropy too low and uses regular PRNG instead of CSPRNG

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.25%, higher than 17% of CVEs (2026-12-01)
- Published: 2024-08-15T18:40:49.750Z
- Modified: 2026-06-17T07:49:31.400Z
- Weaknesses: CWE-330, CWE-352
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- CORDEA oauth: < 0.11

## References

- <https://github.com/CORDEA/oauth/security/advisories/GHSA-332c-q46h-fg8f>
- <https://github.com/CORDEA/oauth/blob/b8c163b0d9cfad6d29ce8c1fb394e5f47182ee1c/src/oauth2.nim#L179>

## Sources

- CVE List: [CVE-2024-42475](https://www.cve.org/CVERecord?id=CVE-2024-42475), CVE Terms of Use, modified 2024-08-19
- NVD: [CVE-2024-42475](https://nvd.nist.gov/vuln/detail/CVE-2024-42475), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-42475 · Whole record: https://cve.day/CVE-2024-42475.json · Rebuilt by cve.day 2026-11-25T22:58:44.422Z
