6.5medium
OAuth library for nim allows insecure generation of state values by generateState - entropy too low and uses regular PRNG instead of CSPRNG
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.25% (higher than 17% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| CORDEA oauth | < 0.11 | CVE List |
Classification
What each source says
CVE List
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.
NVD (es)
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.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-42475 changed 2024-08-19 | CVE Terms of Use |
| NVD | CVE-2024-42475 changed 2026-06-17 | Public domain |