REDHAT-BUG-2553590: High severity go/github.com/getkin/kin-openapi vulnerability
kin-openapi is a Go project for handling OpenAPI files. Prior to 0.149.0, runtime request, response, and direct schema validation lacks cycle detection when an allOf, anyOf, or oneOf chain refers back to an ancestor schema, even though loading and document validation accept the circular reference. A request or response that reaches the affected schema causes unbounded recursion in Schema.visitJSON or openapi3filter.decodeValue and exhausts the Go goroutine stack. The resulting fatal stack overflow cannot be caught with recover and terminates the entire process, including unrelated requests. This issue is fixed in version 0.149.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
kin-openapito a version that resolves this vulnerability.Fixed in 0.149.0
Event History
Frequently Asked Questions
What conditions are required to trigger the denial of service?
An application must perform runtime request validation, response validation, or direct schema validation against a schema in which an allOf, anyOf, or oneOf chain refers back to an ancestor schema. Processing a request or response that reaches that schema causes unbounded recursion.
Can this failure be contained to a single request?
No. The stack overflow is fatal, cannot be caught with recover, and terminates the entire Go process. Unrelated requests handled by the same process are also affected.
Are circular schemas rejected before runtime validation?
No. Loading and document validation accept the circular reference. The failure occurs when affected schemas are reached during runtime validation.
What version resolves the issue?
Upgrade kin-openapi to version 0.149.0 or later. Versions prior to 0.149.0 lack the required cycle detection for these validation paths.