CVE-2026-100350: CWE-400: Uncontrolled Resource Consumption in getkin kin-openapi
Description
### Summary `openapi3filter` decodes `deepObject`-style query parameters by looping over **every** key in the request's query string. Inside that loop it recompiles a **loop-invariant** regular expression on every iteration. The pattern depends only on the spec-defined parameter name, not on the loop variable, so it is compiled `N` times for `N` query keys instead of once. Because the number of query keys is attacker-controlled and unbounded, a single request with many junk query keys forces a proportional number of `regexp.MustCompile` calls, consuming CPU. A handful of concurrent requests can saturate all cores — an uncontrolled-resource-consumption denial of service. This is **not** ReDoS: the pattern is fixed (`^<param>\[`) and matches in linear time. The cost is the **repeated compilation** of an invariant regexp, once per attacker-supplied query key. ### Details In `openapi3filter/req_resp_decoder.go`, the `deepObject` branch of `urlValuesDecoder.DecodeObject` builds a per-parameter property map by iterating over all query keys: ```go case "deepObject": propsFn = func(params url.Values) (map[string]string, error) { props := make(map[string]string) for key, values := range params { // req_resp_decoder.go:689 if !regexp.MustCompile(fmt.Sprintf(`^%s\[`, regexp.QuoteMeta(param))).MatchString(key) { // :690 continue } matches := deepObjectBracketRE.FindAllStringSubmatch(key, -1) ... } ... } ``` The regexp built at `req_resp_decoder.go:690` depends only on `param` — the parameter name defined in the OpenAPI spec — which is **constant** for the whole loop. Yet `regexp.MustCompile(...)` is invoked inside the `for key, values := range params` loop at `req_resp_decoder.go:689`, so it is recompiled once for every key present in the query string. Contrast this with the already-hoisted, package-level regexp used two lines below: ```go var deepObjectBracketRE = regexp.MustCompile(`\[(.*?)\]`) // req_resp_decoder.go:41 ``` `deepObjectBracketRE` is compiled exactly once at package init and reused. The per-parameter pattern at `:690` should be compiled the same way (once, outside the loop), but instead is rebuilt on every iteration. `regexp.MustCompile` costs on the order of a few microseconds per call. The number of iterations equals the number of query keys `N`, which the client fully controls (a ~1 MB URL holds roughly 100k keys). For each `deepObject` parameter `M` defined on the matched route, the request performs `N × M` compilations. The work is CPU-bound, happens during request validation before any handler logic, and scales linearly with request size, so an attacker converts cheap request bytes into expensive server CPU. Affected code path: `ValidateRequest` → `ValidateParameter` → `decodeStyledParameter` → `urlValuesDecoder.DecodeObject` (the `deepObject` case). Any operation with at least one `in: query`, `style: deepObject` parameter is exploitable. ### PoC The following self-contained test (package `openapi3filter_test`) defines a spec with a single `deepObject` query parameter, then validates two requests that differ only in the number of junk query keys. Decoding time grows with the key count even though none of the junk keys are part of the parameter. Save as `openapi3filter/advisory_poc_test.go`: ```go package openapi3filter_test import ( "context" "fmt" "net/http" "strings" "testing" "time" "github.com/getkin/kin-openapi/openapi3" "github.com/getkin/kin-openapi/openapi3filter" "github.com/getkin/kin-openapi/routers/gorillamux" ) const specDeepObjectParam = ` openapi: 3.0.0 info: {title: PoC, version: 1.0.0} paths: /f: get: parameters: - name: filter in: query style: deepObject explode: true schema: {type: object, properties: {a: {type: string}}} responses: '200': {description: ok} ` // TestPoCDeepObjectRegexpCPU demonstrates that decode cost scales with the // number of (attacker-controlled) junk query keys because a loop-invariant // regexp is recompiled once per key. It logs timings for two key counts and // fails if the larger count crosses a clearly-abnormal CPU threshold. func o(t *testing.T) { loader := openapi3.NewLoader() doc, err := loader.LoadFromData([]byte(specDeepObjectParam)) if err != nil { t.Fatalf("load: %v", err) } if err := doc.Validate(loader.Context); err != nil { t.Fatalf("validate: %v", err) } router, err := gorillamux.NewRouter(doc) if err != nil { t.Fatalf("router: %v", err) } run := func(n int) time.Duration { var sb strings.Builder sb.WriteString("/f?filter[a]=x") for i := 0; i < n; i++ { fmt.Fprintf(&sb, "&j%d=1", i) } req, _ := http.NewRequest(http.MethodGet, sb.String(), nil) route, pathParams, err := router.FindRoute(req) if err != nil { t.Fatalf("route: %v", err) } start := time.Now()
CVSS v3.1
Score 5.3medium
Affected software
getkin
kin-openapi
pkg:golang/github.com/getkin/kin-openapiRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The kin-openapi Go library versions >=0.145.0 and <0.146.0 contain a resource consumption vulnerability in the openapi3filter component. Specifically, the function urlValuesDecoder.DecodeObject repeatedly calls regexp.MustCompile for the same parameter-name regular expression inside a per-query-key loop when decoding deepObject query parameters. This leads to repeated recompilation of the same regex expression, causing CPU and memory usage proportional to the number of query keys sent by an unauthenticated remote client. The vulnerability does not involve regex complexity or pattern-based denial of service but inefficient repeated compilation. The issue is resolved in version 0.146.0.
Potential Impact
An unauthenticated remote attacker can cause increased CPU and memory usage on a server using affected kin-openapi versions by sending requests with many unrelated query keys. This can degrade service performance or availability due to excessive resource consumption during request validation. There is no impact on confidentiality or integrity, and no known exploitation in the wild.
Mitigation Recommendations
Upgrade kin-openapi to version 0.146.0 or later, where this issue is fixed. No other mitigations are indicated. Patch status is confirmed fixed in 0.146.0.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-09-25T19:19:54.697Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ad0f5fb2cdf04f65641fdfe
Added to database: 10/15/2026, 15:49:15 UTC
Last enriched: 10/15/2026, 16:18:26 UTC
Last updated: 10/15/2026, 22:07:12 UTC
Views: 13
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.