REDHAT-BUG-2553580: Medium severity go/github.com/getkin/kin-openapi vulnerability
kin-openapi is a Go project for handling OpenAPI files. Prior to 0.145.0, openapi3filter.ValidationHandler uses the routers/legacy router, which passes an unsupported or non-canonical HTTP method for an existing static path to openapi3.PathItem.GetOperation. The default branch of GetOperation panics before authentication runs, so an unauthenticated remote client can repeatedly send methods such as PROPFIND or lowercase get to abort connections and generate stack-trace log growth. The specific panic requires an exact static path; a concrete path matched only by a templated route does not reach the same sink. This issue is fixed in version 0.145.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.145.0
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using kin-openapi before 0.145.0 that use openapi3filter.ValidationHandler with the legacy router are exposed. The vulnerable request must target an exact static path; routes matched only through a path template do not reach this panic.
Does an attacker need authentication or a valid HTTP method?
No. The panic occurs before authentication, and an unauthenticated remote client can trigger it by sending an unsupported or non-canonical method, such as PROPFIND or lowercase get, to an existing static path.
What is the operational impact of exploitation?
Repeated requests can abort connections and cause stack-trace log growth. This can be triggered repeatedly by a remote client.
How can the issue be remediated?
Update kin-openapi to version 0.145.0 or later, which contains the fix.