REDHAT-BUG-2553592: High severity go/github.com/getkin/kin-openapi vulnerability
kin-openapi is a Go project for handling OpenAPI files. From 0.136.0 until 0.149.0, three openapi3filter decoder paths that were missed by the fix for GHSA-p6wj-qrr4-pgh5 lack a nil-items guard for legal OpenAPI 3.1 array schemas. An unauthenticated remote client can trigger a deterministic nil-pointer panic through an array query parameter, a deepObject query parameter containing an array property, or an application/x-www-form-urlencoded request body whose array property appears inside an allOf, anyOf, or oneOf subschema. The query and composed-body paths reach urlValuesDecoder.parseArray, while the deepObject path reaches buildResObj, and all pass a nil items schema into code that dereferences it. This issue is fixed in version 0.149.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.149.0
Event History
Frequently Asked Questions
Which applications are exposed to remote exploitation?
Applications using affected kin-openapi versions that decode OpenAPI 3.1 requests are exposed if their API definitions permit the affected array query parameters, deepObject query parameters with array properties, or form-urlencoded bodies with an array property in an allOf, anyOf, or oneOf subschema.
Does exploitation require authentication or a valid request body?
No authentication is required. A remote client can send a crafted request using one of the affected parameter or request-body decoding paths to trigger a deterministic nil-pointer panic.
What is the impact of successful exploitation?
Successful exploitation causes a nil-pointer panic in the affected decoder code. The provided information describes a deterministic panic and does not indicate data disclosure, modification, or code execution.
What should be done if an affected deployment cannot be upgraded immediately?
The provided information identifies the vulnerable request shapes: array query parameters, deepObject query parameters containing array properties, and application/x-www-form-urlencoded bodies with array properties inside allOf, anyOf, or oneOf subschemas. Restricting or removing those exposed API schema patterns can reduce exposure until an upgrade is possible.
Which version contains the fix?
The issue is fixed in kin-openapi version 0.149.0. Affected versions are from 0.136.0 until 0.149.0.