REDHAT-BUG-2553588: High severity go/github.com/getkin/kin-openapi vulnerability
kin-openapi is a Go project for handling OpenAPI files. Prior to 0.148.0, the OpenAPI 3.1 validation path passes YAML NaN and infinity numeric values to santhosh-tekuri/jsonschema v6.0.2 without applying kin-openapi's existing finite-number guards. A remote unauthenticated client can send an application/yaml or application/x-yaml request body containing .nan, .inf, or -.inf to an operation with a numeric constraint, causing the dependency to create and dereference a nil big.Rat during ValidateRequest. Standard net/http servers recover the panic per connection, while other hosts or application goroutines may terminate the process. This issue is fixed in version 0.148.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.148.0
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Deployments using kin-openapi before 0.148.0 are exposed when they validate OpenAPI 3.1 requests and accept YAML request bodies as application/yaml or application/x-yaml for an operation with a numeric constraint.
What does an attacker need to send to trigger the failure?
A remote unauthenticated client can submit a YAML body containing .nan, .inf, or -.inf for a value subject to a numeric constraint. The vulnerable validation path can then panic during ValidateRequest.
Does the panic always terminate the service?
Standard net/http servers recover the panic per connection. Hosts with different panic handling, or applications that run validation in goroutines without recovery, may terminate the process.
What is the available fix?
Upgrade kin-openapi to version 0.148.0, which fixes the issue.