Skip to content
Heist/ feed
Back to feed
HighFix available

kin-openapi openapi3filter: nil-pointer panic in ValidateResponse on a response header declared with content

Type: advisorySources: OSV

## Summary `ValidateResponse` panics on a nil pointer when a spec declares a response header with `content` instead of `schema`. `doc.Validate()` accepts that document, so the crash comes from a spec the library just called valid. Same class as GHSA-jpcw-4wr7-c3vq, which covered the request-parameter case in v0.144.0; this is the response-header path. Affects `github.com/getkin/kin-openapi` `<= v0.145.0`. Reproduced on master `947498e5a6bd`, Go 1.26. ## Details A `content`-typed response header has `headerRef.Value.Schema == nil`. `validate_response.go:181` passes it straight through: ```go if decodedValue, found, err = decodeValue(dec, headerName, sm, headerRef.Value.Schema, headerRef.Value.Required); err != nil { ``` and `req_resp_decoder.go:273` is where it lands: ```go if len(schema.Value.AllOf) > 0 { ``` Two things I checked rather than assumed. The response does not need to carry the header; declaring it is enough, and then every call for that operation panics. And the body path is fine, `:114` returns early on a nil schema, so this is headers only. The PoC keeps the body case as a control. ## PoC Drop into `openapi3filter/` and run: ``` go test ./openapi3filter/ -run NilSchema -v ``` ```go package openapi3filter_test import ( "context" "io" "net/http" "net/http/httptest" "strings" "testing" "github.com/getkin/kin-openapi/openapi3" "github.com/getkin/kin-openapi/openapi3filter" "github.com/getkin/kin-openapi/routers" ) const specBody = ` openapi: 3.0.3 info: {title: poc

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

Source evidence

kin-openapi openapi3filter: nil-pointer panic in ValidateResponse on a response header declared with content

core-osv · Original source

Published 16 Oct 2026, 19:58 UTC

## Summary `ValidateResponse` panics on a nil pointer when a spec declares a response header with `content` instead of `schema`. `doc.Validate()` accepts that document, so the crash comes from a spec the library just called valid. Same class as GHSA-jpcw-4wr7-c3vq, which covered the request-parameter case in v0.144.0; this is the response-header path. Affects `github.com/getkin/kin-openapi` `<= v0.145.0`. Reproduced on master `947498e5a6bd`, Go 1.26. ## Details A `content`-typed response header has `headerRef.Value.Schema == nil`. `validate_response.go:181` passes it straight through: ```go if decodedValue, found, err = decodeValue(dec, headerName, sm, headerRef.Value.Schema, headerRef.Value.Required); err != nil { ``` and `req_resp_decoder.go:273` is where it lands: ```go if len(schema.Value.AllOf) > 0 { ``` Two things I checked rather than assumed. The response does not need to carry the header; declaring it is enough, and then every call for that operation panics. And the body path is fine, `:114` returns early on a nil schema, so this is headers only. The PoC keeps the body case as a control. ## PoC Drop into `openapi3filter/` and run: ``` go test ./openapi3filter/ -run NilSchema -v ``` ```go package openapi3filter_test import ( "context" "io" "net/http" "net/http/httptest" "strings" "testing" "github.com/getkin/kin-openapi/openapi3" "github.com/getkin/kin-openapi/openapi3filter" "github.com/getkin/kin-openapi/routers" ) const specBody = ` openapi: 3.0.3 info: {title: poc

osv:GHSA-74vm-87hj-r66f

github.com/getkin/kin-openapi

Fixed versions: 0.146.0

Complete source record
{
  "id": "fecf35ce0d90b2fd3357c34485131e7fb4e1f2b2b2e9fd49a54e2d2017f443f5",
  "url": "https://osv.dev/vulnerability/GHSA-74vm-87hj-r66f",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "kin-openapi openapi3filter: nil-pointer panic in ValidateResponse on a response header declared with content",
    "summary": "## Summary `ValidateResponse` panics on a nil pointer when a spec declares a response header with `content` instead of `schema`. `doc.Validate()` accepts that document, so the crash comes from a spec the library just called valid. Same class as GHSA-jpcw-4wr7-c3vq, which covered the request-parameter case in v0.144.0; this is the response-header path. Affects `github.com/getkin/kin-openapi` `<= v0.145.0`. Reproduced on master `947498e5a6bd`, Go 1.26. ## Details A `content`-typed response header has `headerRef.Value.Schema == nil`. `validate_response.go:181` passes it straight through: ```go if decodedValue, found, err = decodeValue(dec, headerName, sm, headerRef.Value.Schema, headerRef.Value.Required); err != nil { ``` and `req_resp_decoder.go:273` is where it lands: ```go if len(schema.Value.AllOf) > 0 { ``` Two things I checked rather than assumed. The response does not need to carry the header; declaring it is enough, and then every call for that operation panics. And the body path is fine, `:114` returns early on a nil schema, so this is headers only. The PoC keeps the body case as a control. ## PoC Drop into `openapi3filter/` and run: ``` go test ./openapi3filter/ -run NilSchema -v ``` ```go package openapi3filter_test import ( \"context\" \"io\" \"net/http\" \"net/http/httptest\" \"strings\" \"testing\" \"github.com/getkin/kin-openapi/openapi3\" \"github.com/getkin/kin-openapi/openapi3filter\" \"github.com/getkin/kin-openapi/routers\" ) const specBody = ` openapi: 3.0.3 info: {title: poc",
    "evidence": "osv:GHSA-74vm-87hj-r66f",
    "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": "high",
    "structured": {
      "id": "GHSA-74vm-87hj-r66f",
      "aliases": [
        "CVE-2026-100349",
        "GHSA-74vm-87hj-r66f"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "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-74vm-87hj-r66f/GHSA-74vm-87hj-r66f.json",
            "last_known_affected_version_range": "<= 0.145.0"
          }
        }
      ],
      "modified": "2026-10-16T20:15:03.610490637Z",
      "provider": "osv",
      "references": [
        "https://github.com/getkin/kin-openapi/security/advisories/GHSA-74vm-87hj-r66f",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-100349",
        "https://github.com/getkin/kin-openapi/commit/f5441d67f855ed34d975b3b85665764644ab1459",
        "https://github.com/getkin/kin-openapi",
        "https://github.com/getkin/kin-openapi/releases/tag/v0.146.0"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-476"
        ],
        "severity": "HIGH",
        "github_reviewed": true,
        "nvd_published_at": "2026-10-15T16:17:30Z",
        "github_reviewed_at": "2026-10-16T19:58:46Z"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-100349",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/database_specific/severity"
  },
  "source_id": "core-osv",
  "document_id": 347720,
  "published_at": "2026-10-16T19:58:46+00:00"
}