CVE-2023-40586 go package github.com/corazawaf/coraza is vulnerable to denial of service

High 7.5 Published Updated

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.

PackageAffectedFixed in
github.com/corazawaf/coraza/v2 GoAll versionsNone
github.com/corazawaf/coraza/v2 GoFrom 2.0.0 to 2.0.1None
github.com/corazawaf/coraza/v2 GoFrom 2.0.0 to 2.0.1None
github.com/corazawaf/coraza/v3 GoAll versions3.0.1
github.com/corazawaf/coraza/v3 GoFrom 3.0.03.0.1
github.com/corazawaf/coraza/v3 GoFrom 3.0.03.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.

Is CVE-2023-40586 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free