# CVE-2024-42476: oauth CSRF vulnerability

- 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.24%, higher than 16% of CVEs (2026-12-01)
- Published: 2024-08-15T18:48:08.325Z
- Modified: 2026-06-17T07:49:31.563Z
- Weaknesses: 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 Authorization Code grant and Implicit grant both rely on the `state` parameter to prevent cross-site request forgery (CSRF) attacks where a resource owner might have their session associated with protected resources belonging to an attacker. When this project is compiled with certain compiler flags set, it is possible that the `state` parameter will not be checked at all, creating a CSRF vulnerability. Version 0.11 checks the `state` parameter using a regular `if` statement or `doAssert` instead of relying on a plain `assert`. `doAssert` will achieve the desired behavior even if `-d:danger` or `--assertions:off` is set.

(As written by CVE List.)

## Affected

- CORDEA oauth: < 0.11

## References

- <https://github.com/CORDEA/oauth/security/advisories/GHSA-pc9j-53g7-5x54>
- <https://github.com/CORDEA/oauth/blob/b8c163b0d9cfad6d29ce8c1fb394e5f47182ee1c/src/oauth2.nim#L235>
- <https://github.com/CORDEA/oauth/blob/b8c163b0d9cfad6d29ce8c1fb394e5f47182ee1c/src/oauth2.nim#L255>

## Sources

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

---

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