Skip to main content
Vulnerability Database/CVE-2026-100350

CVE-2026-100350: kin-openapi DOS Vulnerability

CVE-2026-100350 is a denial of service vulnerability in kin-openapi that allows attackers to consume resources through repeated regexp compilation. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-100350 Overview

CVE-2026-100350 is a resource exhaustion vulnerability in kin-openapi, a Go library for handling OpenAPI files. The flaw affects versions 0.145.0 through 0.145.x and is fixed in 0.146.0. Inside openapi3filter, the urlValuesDecoder.DecodeObject function repeatedly calls regexp.MustCompile for the same parameter-name regular expression within a per-query-key loop while decoding a deepObject query parameter. An unauthenticated remote client can submit a request containing many unrelated query keys to an affected endpoint. This causes ValidateRequest to perform CPU work and allocations proportional to the attacker-controlled key count per deepObject parameter.

Critical Impact

Unauthenticated attackers can trigger disproportionate CPU and memory consumption on services that validate OpenAPI requests, degrading availability through loop-invariant regular expression recompilation. [CWE-400]

Affected Products

  • getkin/kin-openapi versions 0.145.0 up to (but not including) 0.146.0
  • Go services using the openapi3filter package to validate requests with deepObject query parameters
  • API gateways and backend services that call ValidateRequest on untrusted input

Discovery Timeline

  • 2026-10-15 - CVE-2026-100350 published to NVD
  • 2026-10-15 - Last updated in NVD database
  • Fix released - kin-openapi version 0.146.0 ships the patch

Technical Details for CVE-2026-100350

Vulnerability Analysis

The vulnerability resides in the deepObject branch of urlValuesDecoder.DecodeObject in openapi3filter/req_resp_decoder.go. For each incoming query key, the decoder constructs a prefix-match regular expression using regexp.MustCompile(fmt.Sprintf("^%s\\[", regexp.QuoteMeta(param))). The input to MustCompile depends only on param, which is constant across the loop. Compiling it per iteration converts an attacker-controlled query key count into proportional CPU and heap allocations.

The issue is not regular expression denial of service. The expression itself is simple and bounded. The amplification comes from loop-invariant recompilation that an attacker can trigger with a single HTTP request carrying many unrelated query parameters.

Root Cause

The root cause is improper placement of expensive, invariant work inside a hot loop iterating over attacker-controlled input. Each additional query key forces a full regular expression parse, NFA construction, and allocation, even when the key does not match the deepObject prefix.

Attack Vector

An unauthenticated remote client sends a single HTTP request to an endpoint whose OpenAPI schema declares a deepObject query parameter. The request includes a large number of unrelated query keys. For every deepObject parameter defined in the schema, the decoder recompiles the same regular expression once per key, multiplying the work and sustaining elevated CPU use on the target service.

go
// Patch excerpt — openapi3filter/req_resp_decoder.go
			return propsFromString(values[0], ",", ",")
 		}
 	case "deepObject":
+		// Compile the parameter-name prefix matcher once: it depends only on
+		// param (constant for the whole loop), not on the loop variable. Doing
+		// this inside the loop recompiles it once per query key, turning an
+		// attacker-controlled key count into proportional CPU.
+		paramPrefixRE := regexp.MustCompile(fmt.Sprintf(`^%s\[`, regexp.QuoteMeta(param)))
 		propsFn = func(params url.Values) (map[string]string, error) {
 			props := make(map[string]string)
 			for key, values := range params {
-				if !regexp.MustCompile(fmt.Sprintf(`^%s\[`, regexp.QuoteMeta(param))).MatchString(key) {
+				if !paramPrefixRE.MatchString(key) {
 					continue
 				}
 				matches := deepObjectBracketRE.FindAllStringSubmatch(key, -1)

Source: GitHub commit d090e36b. The fix hoists the MustCompile call outside the per-key loop so it runs once per deepObject parameter rather than once per attacker-supplied query key.

Detection Methods for CVE-2026-100350

Indicators of Compromise

  • HTTP requests to OpenAPI-validated endpoints containing hundreds or thousands of unique query keys in the URL
  • Sustained spikes in CPU time attributed to regexp.MustCompile, syntax.Parse, or openapi3filter call paths in Go service profiles
  • Elevated latency and heap allocations correlated with requests to endpoints that declare deepObject query parameters

Detection Strategies

  • Audit application dependencies for github.com/getkin/kin-openapi at versions 0.145.0 through 0.145.x using go list -m all or software composition analysis tooling
  • Inspect web access logs for anomalous query-string length and unique parameter counts on routes handled by openapi3filter.ValidateRequest
  • Enable Go pprof CPU profiling in staging to confirm MustCompile dominates request processing under crafted inputs

Monitoring Recommendations

  • Alert on sustained increases in request processing time and goroutine count on API gateway or backend services using OpenAPI validation
  • Track per-endpoint query parameter cardinality and flag requests exceeding reasonable thresholds (for example, more than 100 unique keys)
  • Correlate upstream rate-limiter events with downstream CPU saturation on services exposing deepObject schemas

How to Mitigate CVE-2026-100350

Immediate Actions Required

  • Upgrade github.com/getkin/kin-openapi to version 0.146.0 or later and redeploy affected services
  • Inventory services that import openapi3filter and prioritize those exposing endpoints with deepObject query parameters
  • Place rate limits and request size restrictions in front of OpenAPI-validated endpoints at the reverse proxy or API gateway

Patch Information

The fix is included in kin-openapi release v0.146.0 and tracked in GitHub Security Advisory GHSA-h4r5-mxv5-8mjc. The patch, shown in commit d090e36b, hoists the regexp.MustCompile call outside the per-query-key loop so the parameter-name matcher compiles once per deepObject parameter.

Workarounds

  • Reject requests with excessive query parameter counts or oversized query strings at an upstream proxy such as NGINX, Envoy, or a WAF
  • Remove or avoid defining deepObject query parameters in OpenAPI schemas on untrusted endpoints until the library can be upgraded
  • Apply per-client rate limiting and concurrency caps to constrain CPU amplification from a single source
bash
# Example: upgrade kin-openapi in a Go module
go get github.com/getkin/kin-openapi@v0.146.0
go mod tidy
go build ./...

# Verify the resolved version
go list -m github.com/getkin/kin-openapi

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.