CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-77354

CVE-2026-77354: Uncontrolled Resource Consumption (OOM) via Sparse Array Indexes in kin-openapi

Amit Schendel
Amit Schendel
Senior Security Researcher

Aug 22, 2026·8 min read·32 visits

Executive Summary (TL;DR)

An unauthenticated remote attacker can crash Go services using kin-openapi (openapi3filter) by passing a highly sparse array index in a deepObject query parameter, causing massive memory allocations before validation takes place.

An uncontrolled resource consumption vulnerability (CWE-400/CWE-789) exists within the kin-openapi Go library prior to version 0.142.0. The vulnerability occurs during the processing of highly sparse array indexes inside query parameters defined in deepObject style. An unauthenticated remote attacker can exploit this flaw to cause an immediate Out-of-Memory (OOM) crash of the target application.

Vulnerability Overview

The Go package kin-openapi is widely used within the Go ecosystem for handling, parsing, and validating OpenAPI v3 specifications. Within this package, the openapi3filter sub-module plays a critical role by acting as request and response validation middleware. It intercepts incoming HTTP traffic, maps parameters to their respective OpenAPI schema definitions, and evaluates them to ensure compliance before routing requests to core application logic.

A critical vulnerability exists within the query parameter parsing logic of openapi3filter, specifically affecting parameters styled as deepObject that contain arrays. When processing such parameters, the decoding engine converts HTTP query strings into nested Go map representations before transforming them into slices. If a remote, unauthenticated attacker supplies a highly sparse array index inside a query parameter, the internal conversion routine experiences uncontrolled memory allocation.

This vulnerability is classified under CWE-400 (Uncontrolled Resource Consumption) and CWE-789 (Memory Allocation with Excessive Size Value). Because the resource allocation occurs during the decoding phase, it bypasses downstream schema-defined constraints such as maxItems or length validations. Consequently, the affected process attempts to satisfy massive memory demands instantly, resulting in an immediate Out-of-Memory (OOM) abort.

Root Cause Analysis

The vulnerability was introduced in kin-openapi version 0.124.0 in commit 78bb273e5892da3b0c8fc31857499449adfaba6c. This commit added capabilities for handling complicated deepObject types, including arrays of nested objects and multi-dimensional arrays. When query parameter strings are parsed, standard arrays are typically received in index-value format, which the library translates into an intermediate string-keyed map, such as map[string]any with keys representing indexes (e.g. "0", "1").

To construct a contiguous Go slice from this intermediate map, openapi3filter invokes the helper function sliceMapToSlice within openapi3filter/req_resp_decoder.go. The logic converts the map's string keys into integer slice indices, determines the maximum index value (max), and then executes an allocation loop to build the final slice. However, the upper boundary of this loop is set directly to the max value extracted from client-controlled input, without verifying the total number of elements actually present in the map.

When a client transmits a request containing a single extremely high index (e.g., 50000000), the max variable is evaluated as 50000000. The function then loops from index 0 up to 50000000, filling non-existent intermediate elements with nil pointers via iterative append() operations. This behavior forces the Go runtime to iteratively grow and copy the slice within the heap, consuming substantial CPU cycles and physical RAM.

This mechanism results in severe memory amplification. While the physical HTTP payload sent by the attacker may be less than 50 bytes, the corresponding memory allocation in the application runtime climbs to several hundred megabytes or gigabytes. Furthermore, because this processing is performed during the initial request-decoding layer, any schema-level protections such as parameter constraints are completely inactive, rendering validation mechanisms ineffective.

Code Analysis

To understand the structural failure, we can examine the vulnerable implementation of the sliceMapToSlice function in openapi3filter/req_resp_decoder.go prior to version 0.142.0:

func sliceMapToSlice(m map[string]interface{}) ([]interface{}, error) {
	var result []interface||
 
	keys := make([]int, 0, len(m))
	for k := range m {
		key, err := strconv.Atoi(k)
		if err != nil {
			return nil, fmt.Errorf("array indexes must be integers: %w", err)
		}
		keys = append(keys, key)
	}
	max := -1
	for _, k := range keys {
		if k > max {
			max = k
		}
	}
	for i := 0; i <= max; i++ {
		val, ok := m[strconv.Itoa(i)]
		if !ok {
			result = append(result, nil)
			continue
		}
		result = append(result, val)
	}
	return result, nil
}

In this version, the loop for i := 0; i <= max; i++ is completely unbounded. Each iteration where ok is false results in result = append(result, nil). This forces the runtime to dynamically reallocate and copy the underlying backing array of the slice, introducing significant memory overhead.

This allocation is followed by a secondary copy inside the buildResObj calling function. This function instantiates a secondary duplicate slice using resultArr := make([]interface{}, len(arr)) where arr is the slice returned by sliceMapToSlice. This operation duplicates the massive memory requirement, instantly doubling the heap allocation size.

To resolve this vulnerability, the maintainers implemented a density check in commit 1223a0f215d2cf9beb2d9eb9ea2649d001c21388 by capping the maximum permitted gap between the theoretical slice size and the actual number of elements provided by the client:

// maxSliceMapToSliceGap bounds how many synthesized nil holes sliceMapToSlice
// will fill in for a sparse array before rejecting the input.
const maxSliceMapToSliceGap = 10000
 
func sliceMapToSlice(m map[string]any) ([]any, error) {
	var result []any
	keys := make([]int, 0, len(m))
	for k := range m {
		key, err := strconv.Atoi(k)
		if err != nil {
			return nil, fmt.Errorf("array indexes must be integers: %w", err)
		}
		if key < 0 {
			return nil, fmt.Errorf("array indexes must not be negative: %d", key)
		}
		keys = append(keys, key)
	}
	max := -1
	for _, k := range keys {
		if k > max {
			max = k
		}
	}
	// Evaluate the gap size
	if gap := max + 1 - len(m); gap > maxSliceMapToSliceGap {
		return nil, fmt.Errorf("array index %d is too sparse relative to the %d supplied items", max, len(m))
	}
	// Array generation proceeds if gap is within limits

The introduction of maxSliceMapToSliceGap successfully limits the gap size to a maximum of 10000. By checking if gap := max + 1 - len(m); gap > maxSliceMapToSliceGap, the software rejects requests with sparse indices before entering the allocation loop. This effectively forces attackers to transmit actual payloads proportional to the requested allocation size, which is mitigated by standard HTTP server payload limits.

Exploitation and Attack Methodology

An attack targeting this vulnerability is easily executed, requiring no authentication, low bandwidth, and zero pre-existing session state. The target must expose an endpoint validated by openapi3filter that expects a query parameter configured with the deepObject serialization style and containing an array schema. An example OpenAPI parameter definition is shown below:

parameters:
  - name: filter
    in: query
    style: deepObject
    explode: true
    schema:
      type: object
      properties:
        items:
          type: array
          items:
            type: string

To exploit this configuration, an attacker transmits an HTTP GET request containing a parameter with a highly sparse array index, as shown in this payload:

GET /search?filter[items][50000000]=x HTTP/1.1
Host: vulnerable-service.local
Connection: close

When the application processes this request, the parameter decoder translates the key into a map: map[string]any{"50000000": "x"}. The sliceMapToSlice function reads this key, identifies 50000000 as the maximum index, and attempts to initialize a slice with 50,000,001 entries. On a 64-bit architecture, each interface slot consumes 16 bytes. The initial backing slice requires 800 megabytes. When accounting for Go runtime memory overhead, iterative slice resizing, and the secondary allocation within buildResObj, the heap immediately expands by several gigabytes, triggering the kernel's Out-Of-Memory (OOM) killer to terminate the service process.

Impact Assessment and Operational Risk

The vulnerability poses a severe risk to service availability. Because the parsing logic is executed early in the HTTP request processing pipeline, any validation steps, authorization checks, or rate-limiting layers that operate post-decoding cannot mitigate the threat. The vulnerability can be exploited by an unauthenticated, remote attacker with minimal network footprint.

In modern containerized microservice architectures (such as Kubernetes or ECS), an OOM crash of a single pod can propagate failure throughout the cluster. If the service is behind an automated load balancer, the termination of one replica will cause the load balancer to route pending requests to the remaining healthy replicas. An attacker can continuously transmit the sparse index payload, systematically knocking out each newly spawned container and achieving a complete, sustained Denial of Service.

While this vulnerability does not lead to remote code execution or data exposure (confidentiality and integrity remain unaffected), the availability impact is severe. This is reflected in the CVSS v4.0 vector string CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N, highlighting network-based, low-complexity exploitation with high availability consequences.

Detection and Remediation

To address this vulnerability, administrators and developers must upgrade github.com/getkin/kin-openapi to version 0.142.0 or higher. This release contains the patch that limits sparse array index mapping via the maxSliceMapToSliceGap safety threshold.

If immediate upgrading is not feasible, organizations can implement detection and blocking rules at the Web Application Firewall (WAF) layer. Since the exploit relies on sending extremely large integer indices inside brackets, a custom regular expression rule can inspect the query string. The following rule detects any array bracket indices containing large numerical values (10,000 or greater):

(?i)\\b\\w+\\[\\w+\\]\\[(?:[1-9]\\d{4,})\\]=

Additionally, operations teams can configure resource limit constraints on containers. While this does not prevent the target process from crashing, it prevents a single vulnerable service from consuming the host node's entire physical memory, minimizing the impact on co-located services.

Fix Analysis (1)

Technical Appendix

CVSS Score
8.7/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Affected Systems

Go applications implementing github.com/getkin/kin-openapi/openapi3filter

Affected Versions Detail

Product
Affected Versions
Fixed Version
kin-openapi
getkin
>= 0.124.0, < 0.142.00.142.0
AttributeDetail
CWE IDCWE-400, CWE-789
Attack VectorNetwork
CVSS v4.0 Score8.7 (High)
EPSS ScoreNot Available
ImpactDenial of Service (OOM Process Crash)
Exploit StatusProof-of-Concept
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-400
Uncontrolled Resource Consumption

The software does not properly control the allocation and maintenance of a limited resource, enabling an actor to influence the amount of resources consumed.

Vulnerability Timeline

Vulnerable code path introduced in version 0.124.0
2024-03-22
Remediation patch committed to repository
2026-07-11
Security Advisory and CVE-2026-77354 published
2026-08-21

References & Sources

  • [1]GHSA-xhj3-7xw9-vr34: Out of memory vulnerability in getkin/kin-openapi
  • [2]Pull Request #923: deepObject support for array values
  • [3]Fix Commit 1223a0f
  • [4]Release v0.142.0

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•19 minutes ago•CVE-2026-126298
7.5

CVE-2026-126298: Quadratic Algorithmic Complexity Denial of Service in NLTK Tree.chomsky_normal_form

CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.

Alon Barad
Alon Barad
1 views•12 min read
•about 1 hour ago•CVE-2026-126299
7.5

CVE-2026-126299: Quadratic Algorithmic Complexity Denial of Service in NLTK CCG Lexicon Parser

An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.

Alon Barad
Alon Barad
3 views•10 min read
•about 2 hours ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 3 hours ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 4 hours ago•GHSA-GPWC-27CW-RH9R
5.3

CVE-2026-126301: Quadratic CPU Exhaustion in NLTK LegalitySyllableTokenizer

The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.

Amit Schendel
Amit Schendel
4 views•10 min read
•about 5 hours ago•CVE-2026-126304
8.7

CVE-2026-126304: Symlink Path Traversal in NLTK YCOECorpusReader

CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.

Amit Schendel
Amit Schendel
6 views•9 min read