Getkin kin-openapi
kin-openapi: ValidationHandler security-requirement bypass via encoded-path operation confusion
kin-openapi is a Go project for handling OpenAPI files. From 0.144.0 until 0.147.0, openapi3filter.ValidationHandler validates an operation selected from decoded URL.Path while a downstream gorilla/mux router configured with UseEncodedPath can dispatch a different operation selected from URL.RawPath. When a public exact route and a protected parameterized route use the same method and overlap after decoding, an unauthenticated remote request containing an encoded path separator can be validated as public and then dispatched to the protected handler without invoking the configured AuthenticationFunc. The reachable path parameter is constrained to an encoded representation that decodes to the public literal route, and proxies that canonicalize the URI before forwarding prevent this specific mismatch. This issue is fixed in version 0.147.0.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 0.144.0, < 0.147.0
Fixed in 0.147.0
Mitigation
Upgrade kin-openapi to 0.147.0 or later.
References
- Vendor advisory github.com/getkin/kin-openapi/security/advisor…
- Patch github.com/getkin/kin-openapi/commit/eda80e267…
- Release notes github.com/getkin/kin-openapi/releases/tag/v0.…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.