Skip to content
Heist/ feed
Back to feed
MediumFix available

kin-openapi deepObject query decoding repeatedly compiles an invariant regular expression

Type: advisorySources: OSV

### 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 (`^\[`) 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 na

Products
github.com/getkin/kin-openapi
Affected versions
Not specified
Fixed versions
0.146.0
CVEs
CVE-2026-100350
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 19:14 UTC · Revision 1

Source evidence

kin-openapi deepObject query decoding repeatedly compiles an invariant regular expression

core-osv · Original source

Published 15 Oct 2026, 20:18 UTC

### 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 (`^\[`) 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 na

osv:GHSA-h4r5-mxv5-8mjc

github.com/getkin/kin-openapi

Fixed versions: 0.146.0

Complete source record
{
  "id": "d5b1bbcb6be8c619d0c5b2f35f4f3fb90e87041b376653b83fb257828d74eb62",
  "url": "https://osv.dev/vulnerability/GHSA-h4r5-mxv5-8mjc",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "kin-openapi deepObject query decoding repeatedly compiles an invariant regular expression",
    "summary": "### 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 (`^\\[`) 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 na",
    "evidence": "osv:GHSA-h4r5-mxv5-8mjc",
    "products": [
      {
        "name": {
          "value": "github.com/getkin/kin-openapi",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "0.146.0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "GHSA-h4r5-mxv5-8mjc",
      "aliases": [
        "CVE-2026-100350",
        "GHSA-h4r5-mxv5-8mjc"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.145.0"
                },
                {
                  "fixed": "0.146.0"
                }
              ]
            }
          ],
          "package": {
            "name": "github.com/getkin/kin-openapi",
            "purl": "pkg:golang/github.com/getkin/kin-openapi",
            "ecosystem": "Go"
          },
          "database_specific": {
            "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-h4r5-mxv5-8mjc/GHSA-h4r5-mxv5-8mjc.json"
          }
        }
      ],
      "modified": "2026-10-15T20:30:07.453128014Z",
      "provider": "osv",
      "references": [
        "https://github.com/getkin/kin-openapi/security/advisories/GHSA-h4r5-mxv5-8mjc",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-100350",
        "https://github.com/getkin/kin-openapi/commit/d090e36b2f1c42c898ba2a687a8f6e25f5ca727f",
        "https://github.com/getkin/kin-openapi",
        "https://github.com/getkin/kin-openapi/releases/tag/v0.146.0"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-1050",
          "CWE-400",
          "CWE-770"
        ],
        "severity": "MODERATE",
        "github_reviewed": true,
        "nvd_published_at": "2026-10-15T16:17:30Z",
        "github_reviewed_at": "2026-10-15T20:18:15Z"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-100350",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 336057,
  "published_at": "2026-10-15T20:18:15+00:00"
}