CVE-2023-40586 go package github.com/corazawaf/coraza is vulnerable to denial of service
Attackers can crash applications using the Coraza WAF library by sending crafted requests that trigger a fatal error in media type parsing.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-40586?
CVE-2023-40586 is a high-severity denial of service vulnerability in corazawaf coraza, published on 25 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
OWASP Coraza WAF is a golang modsecurity compatible web application firewall library. Due to the misuse of `log.Fatalf`, the application using coraza crashed after receiving crafted requests from attackers. The application will immediately crash after receiving a malicious request that triggers an error in `mime.ParseMediaType`. This issue was patched in version 3.0.1.
Weakness: CWE-400
Which versions are affected by CVE-2023-40586?
6 open source packages ship an affected version, including github.com/corazawaf/coraza/v2 and github.com/corazawaf/coraza/v3. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/corazawaf/coraza/v2 Go | All versions | None |
github.com/corazawaf/coraza/v2 Go | From 2.0.0 to 2.0.1 | None |
github.com/corazawaf/coraza/v2 Go | From 2.0.0 to 2.0.1 | None |
github.com/corazawaf/coraza/v3 Go | All versions | 3.0.1 |
github.com/corazawaf/coraza/v3 Go | From 3.0.0 | 3.0.1 |
github.com/corazawaf/coraza/v3 Go | From 3.0.0 | 3.0.1 |
Products include Coraza Coraza.
How do I fix CVE-2023-40586?
Upgrade to a fixed version.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2023-40586 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-40586 exists.
Sources
Also known as GHSA-c2pj-v37r-2p6h, GO-2023-1874.