CVE-2024-37298: Memory Exhaustion Attack in github.com/gorilla/schema

github.com/gorilla/schema Updated 02 Oct 2025

Summary

01/07/2024
Yes i
High
7.5

CVE-2024-37298: Potential memory exhaustion attack due to sparse slice deserialization. Affects github.com/gorilla/schema versions < 1.4.1. Fixed in 1.4.1. How to fix ↓

Also tracked for

The same CVE-2024-37298 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

github.com/gorilla/schema is a Go package that provides a decoder for mapping HTTP form values to Go structs. It is commonly used in web applications to handle form data. The package allows developers to define structs with arrays of other structs, which can be vulnerable to a memory exhaustion attack due to sparse slice deserialization.

Vulnerability Detail

The vulnerability arises when the schema.Decoder.Decode() function is used on a struct that contains a field of type []struct{...}. This opens up the possibility of a malicious attack that exploits the sparse slice functionality. By specifying a field value for a very large index, such as the billionth element, the decoder will allocate memory for all the elements before it in the slice. An attacker can abuse this behavior to exhaust system memory and potentially cause a denial-of-service (DoS) condition. The Proof of Concept provided demonstrates how an endpoint can be called with a specific parameter to freeze the system due to excessive memory allocation.

How To Fix

Latest published version: v1.4.1 as of 23 Oct 2026

go get github.com/gorilla/schema@v1.4.1

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.4.1

This is the first release that contains the fix.

go get github.com/gorilla/schema@v1.4.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to update to the fixed version of the package as soon as possible.

Conclusion

The memory exhaustion attack vulnerability in github.com/gorilla/schema can be mitigated by updating to version 1.4.1 or later. This ensures that the vulnerable code is replaced with a secure implementation. It is important for developers to promptly address this vulnerability to prevent potential denial-of-service (DoS) attacks.

See every vulnerability recorded for github.com/gorilla/schema →

Share this vulnerability

FAQ

github.com/gorilla/schema is a Go package that provides a decoder for mapping HTTP form values to Go structs. It is commonly used in web applications for handling form data.

The vulnerability allows an attacker to perform a memory exhaustion attack, potentially leading to a denial-of-service (DoS) condition. By exploiting the sparse slice deserialization, an attacker can allocate excessive memory and freeze the system.

To fix this vulnerability, update the github.com/gorilla/schema package to version 1.4.1 or later. This version includes a fix for the memory exhaustion attack.

No, there is no known workaround for this vulnerability. It is recommended to update to the fixed version of the package.

Yes, you can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities without requiring access to the code or installation.

How To Fix

Latest published version: v1.4.1 as of 23 Oct 2026

go get github.com/gorilla/schema@v1.4.1

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.4.1

This is the first release that contains the fix.

go get github.com/gorilla/schema@v1.4.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback