kin-openapi: Unauthenticated panic (DoS) in openapi3filter legacy router via non-canonical/unsupported HTTP method on a static pathGHSA-fh4f-47mf-f2gj
MEDIUMFix: getkin/kin-openapi@f1a5b52GHSA-fh4f-47mf-f2gj is a medium-severity (CVSS 5.3) Improper Input Validation vulnerability in github.com/getkin/kin-openapi. A fix is available for github.com/getkin/kin-openapi — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for GHSA-fh4f-47mf-f2gj.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-fh4f-47mf-f2gj by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
github.com/getkin/kin-openapiReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
The openapi3filter.ValidationHandler (the exported, documented request-validation middleware) hard-wires the legacy router (routers/legacy). That router matches the incoming request method verbatim against a trie built exclusively from upper-cased canonical HTTP methods. A request carrying a method token that is not one of the 9 standard methods — a legitimate-but-unsupported token such as PROPFIND, or a non-canonical case variant such as lowercase get — misses the trie, leaves route == nil, and for an existing static path falls through to PathItem.GetOperation(method), whose default: case calls panic(...). The panic fires inside route resolution, before any authentication runs. This is an unauthenticated, remotely triggerable denial of service (recovered per-connection panic + unbounded error-log growth).
Root Cause
openapi3filter/validation_handler.go:39—ValidationHandler.Load()always constructslegacyrouter.NewRouter(doc); there is no alternative router option on this path.routers/legacy/router.go:109— the request method is used verbatim (method, url := req.Method, ...); there is no canonicalization or rejection of unknown method tokens.routers/legacy/router.go:69-70— the trie is populated withstrings.ToUpper(method)keys taken frompathItem.Operations()(canonicalhttp.Method*constants only).routers/legacy/router.go:141—root.Match(method + " " + remainingPath)misses for a non-canonical/unsupported method →route == nil.routers/legacy/router.go:146-150— in theroute == nilblock,doc.Paths.Value(path)returns non-nil for an existing static path, and control reachespathItem.GetOperation(method).openapi3/path_item.go:174—GetOperation'sswitch methodhas no matching case →default: panic(fmt.Errorf("unsupported HTTP method %q", method)).
Impact
An unauthenticated attacker sends a single request with a non-standard HTTP method token to any existing static path. The handler goroutine panics; Go's net/http recovers the panic per connection (process survives), aborts the connection (client sees a reset / 500), and logs a full stack trace. Repeated requests cause connection churn and unbounded http: panic serving log growth, and the request never reaches authentication. Availability impact (A:L) under the default synchronous ValidationHandler middleware; on non-net/http hosts or when reached on an application goroutine the ceiling is a full crash.
Proof of Concept
Serve any spec with a static path (e.g. /ping) behind openapi3filter.ValidationHandler, then:
printf 'PROPFIND /ping HTTP/1.1\r\nHost: x\r\n\r\n' | nc target 8080 # connection aborted (panic)
printf 'get /ping HTTP/1.1\r\nHost: x\r\n\r\n' | nc target 8080 # connection aborted (panic)
printf 'GET /ping HTTP/1.1\r\nHost: x\r\n\r\n' | nc target 8080 # 200 OK (process survived)
Reproduced end-to-end against a real net/http.Server + ValidationHandler: PROPFIND /ping and lowercase get /ping both abort the connection with a panic at path_item.go:174 (stack: GetOperation <- legacy.FindRoute router.go:150 <- ValidationHandler.validateRequest validation_handler.go:84); the process stays alive and subsequent GET /ping returns 200.
Attack Chain
- Entry: unauthenticated
PROPFIND /ping HTTP/1.1(any known static path). Guard: net/http method validation. Bypass proof: net/http accepts any valid HTTP token as a method —PROPFINDand lowercasegetboth reach the handler. - Route match:
legacy/router.go:141root.Match("PROPFIND /ping"). Guard: trie match. Bypass proof: trie holds only upper-cased canonical methods → miss →route == nil. route == nilblock:router.go:146doc.Paths.Value("/ping")→ non-nil for an existing static path (exact map lookup). Guard:pathItem == nilcheck (l.147). Bypass proof: static path exists → not nil → proceeds.- Sink:
router.go:150pathItem.GetOperation("PROPFIND")→path_item.go:174default: panic(...). - Impact: handler goroutine panics; net/http recovers per connection; request never reaches auth.
Bypass Evidence
- net/http does NOT reject non-standard method tokens — confirmed empirically:
PROPFINDand lowercasegetboth reached the handler and panicked. - No canonicalization/rejection exists between
FindRouteentry andGetOperation;req.Methodis used verbatim (router.go:109). git show v0.144.0:openapi3/path_item.goshowspanic(...)at line 174;git show v0.144.0:routers/legacy/router.goshows verbatim method use and the unguardedGetOperationcall.git log v0.144.0..HEADon these files is empty (no post-tag fix).
Scoping Note
The panic requires the request path to be an exact static (non-templated) key in the served spec. A concrete path against a /{id} template returns a clean 500 (not a panic), because Paths.Value is an exact map lookup. Static paths (/health, /login, /version, /metrics, /ping, /) are ubiquitous in real specs and discoverable from public specs/standard endpoints, so a vulnerable target almost always exists. This makes the finding arguably broader than existing panic advisories, as it needs no special spec construct — any static path suffices.
Affected Versions
<= 0.144.0 (present on the latest release tag v0.144.0; long-standing; no patched version).
Suggested Fix
In the legacy router, canonicalize/validate the request method before route resolution and return ErrMethodNotAllowed/ErrPathNotFound for unknown methods, or make PathItem.GetOperation return an error (nil) for unrecognized methods instead of calling panic.
Reported by zx (Jace) — GitHub: @manus-use
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/getkin/kin-openapi | all versions | 0.145.0go get github.com/getkin/kin-openapi@v0.145.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/getkin/kin-openapi, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/getkin/kin-openapi to 0.145.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-fh4f-47mf-f2gj is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Hardened Images | grafana12-4-main-12.4.12-0.4.hum1 | RHSA-2026:76677 |
| Red Hat Hardened Images | hugo-main-0.168.0-0.1.hum1 | RHSA-2026:82637 |
| Red Hat Hardened Images | grafana13-2-main-13.2.3-0.3.hum1 | RHSA-2026:85266 |
| Red Hat Hardened Images | grafana13-1-main-13.1.8-0.3.hum1 | RHSA-2026:87077 |
Frequently Asked Questions
Is GHSA-fh4f-47mf-f2gj in your dependencies?
Find it across Go, including transitive dependencies.