Vulnerability · Published Feb 17, 2024 · Assigned by snyk
CVE-2024-21495
Medium 6.5
In plain English
A medium-severity weak randomness in github.com/greenpau/caddy-security. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 53% of all known vulnerabilities).
Official description
Versions of the package github.com/greenpau/caddy-security before 1.0.42 are vulnerable to Insecure Randomness due to using an insecure random number generation library which could possibly be predicted via a brute-force search. Attackers could use the potentially predictable nonce value used for authentication purposes in the OAuth flow to conduct OAuth replay attacks. In addition, insecure randomness is used while generating multifactor authentication (MFA) secrets and creating API keys in the database package.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Go | github.com/greenpau/caddy-security | no fix listed | GHSA-c7vf-m394-m4x4 |
| Go | github.com/greenpau/caddy-security | no fix listed | GO-2024-2565 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| n/a | github.com/greenpau/caddy-security | 0 – before 1.0.42 |
Weakness: CWE-330 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N/E:P
References
- https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMGREENPAUCADDYSECURITY-6248275
- https://github.com/greenpau/go-authcrunch/commit/ecd3725baf2683eb1519bb3c81ae41085fbf7dc2
- https://blog.trailofbits.com/2023/09/18/security-flaws-in-an-sso-plugin-for-caddy/
- https://github.com/greenpau/caddy-security/issues/265