CVE-2024-37298 is a high-severity (CVSS 7.5) CWE-770 vulnerability in github.com/gorilla/schema. A fix is available for github.com/gorilla/schema — see the affected versions and patch details below.
Potential memory exhaustion attack due to sparse slice deserialization
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-37298.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
CVE-2024-37298 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 378,567 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
github.com/gorilla/schemaReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Details
Running schema.Decoder.Decode() on a struct that has a field of type []struct{...} opens it up to malicious attacks regarding memory allocations, taking advantage of the sparse slice functionality. For instance, in the Proof of Concept written below, someone can specify to set a field of the billionth element and it will allocate all other elements before it in the slice.
In the local environment environment for my project, I was able to call an endpoint like /innocent_endpoint?arr.10000000.X=1 and freeze my system from the memory allocation while parsing r.Form. I think this line is responsible for allocating the slice, although I haven't tested to make sure, so it's just an educated guess.
Proof of Concept
The following proof of concept works on both v1.2.0 and v1.2.1. I have not tested earlier versions.
package main
import (
"fmt"
"github.com/gorilla/schema"
)
func main() {
dec := schema.NewDecoder()
var result struct {
Arr []struct{ Val int }
}
if err := dec.Decode(&result, map[string][]string{"arr.1000000000.Val": {"1"}}); err != nil {
panic(err)
}
fmt.Printf("%#+v\n", result)
}
Impact
Any use of schema.Decoder.Decode() on a struct with arrays of other structs could be vulnerable to this memory exhaustion vulnerability. There seems to be no possible solution that a developer using this library can do to disable this behaviour without fixing it in this project, so all uses of Decode that fall under this umbrella are affected. A fix that doesn't require a major change may also be harder to find, since it could break compatibility with some other intended use-cases.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/gorilla/schema | all versions | 1.4.1go get github.com/gorilla/schema@v1.4.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/gorilla/schema, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/gorilla/schema to 1.4.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-37298 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2024-37298 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2024-37298. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This vulnerability in the gorilla/schema package is a high-severity issue due to its potential to cause a Denial of Service (DoS) attack through memory exhaustion. The schema.Decoder.Decode() function, when processing a struct with fields of type []struct{...}, is susceptible to malicious input that exploits sparse…
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Advanced Cluster Security 4.4 | advanced-cluster-security/rhacs-central-db-rhel8:4.4.5-2 | RHSA-2024:6054 |
| Red Hat Enterprise Linux 8 | container-tools:rhel8-8100020240808093819.afee755d | RHSA-2024:5258 |
| Red Hat Enterprise Linux 8.8 Extended Update Support | container-tools:rhel8-8080020240724065004.0f77c1b7 | RHSA-2024:5194 |
| Red Hat Enterprise Linux 9 | podman-4:4.9.4-10.el9_4 | RHSA-2024:6194 |
| Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions | podman-2:4.2.0-5.el9_0 | RHSA-2024:4825 |
| Red Hat Enterprise Linux 9.2 Extended Update Support | podman-2:4.4.1-20.el9_2 | RHSA-2024:5634 |
| Red Hat OpenShift Container Platform 4.12 | podman-3:4.2.0-11.rhaos4.12.el9 | RHSA-2024:5202 |
| Red Hat OpenShift Container Platform 4.13 | podman-3:4.4.1-10.3.rhaos4.13.el9 | RHSA-2024:4848 |
Frequently Asked Questions
Is CVE-2024-37298 in your dependencies?
O3 Security finds CVE-2024-37298 across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.