CVE-2024-42475
JSON

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 packageVersionsReported by
CORDEA oauth< 0.11CVE List

Classification

CWE-330CWE-352

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

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

SourceRecordLicence
CVE ListCVE-2024-42475 changed 2024-08-19CVE Terms of Use
NVDCVE-2024-42475 changed 2026-06-17Public domain