REDHAT-BUG-2553571: Medium severity go/github.com/getkin/kin-openapi vulnerability
kin-openapi is a Go project for handling OpenAPI files. Prior to 0.145.0, openapi3.Loader can dereference a nil SchemaRef.Value while resolving a self-referential additionalProperties JSON Reference such as a schema that points to its own additionalProperties member. Loading an attacker-controlled OpenAPI document through LoadFromData, LoadFromFile, or LoadFromURI reaches resolveComponent before document validation and can panic the loading process. Resolved additionalProperties schemas and ordinary recursive schemas do not take the vulnerable nil-value path. This issue is fixed in version 0.145.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.145.0
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using kin-openapi before 0.145.0 are exposed if they load attacker-controlled OpenAPI documents through LoadFromData, LoadFromFile, or LoadFromURI.
What must an attacker provide to trigger the failure?
The attacker needs to supply an OpenAPI document containing a self-referential additionalProperties JSON Reference, such as a schema that points to its own additionalProperties member. Processing that document can panic the loading process before document validation occurs.
Are all recursive OpenAPI schemas affected?
No. Ordinary recursive schemas and resolved additionalProperties schemas do not take the vulnerable nil-value path; the issue is specific to the self-referential additionalProperties JSON Reference case.
What version fixes the issue?
Upgrade kin-openapi to version 0.145.0 or later.