Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-100354 Overview
CVE-2026-100354 is an unbounded recursion vulnerability in kin-openapi, a Go library for parsing and validating OpenAPI documents. Versions prior to 0.149.0 fail to detect schema cycles during runtime request, response, and direct schema validation. When an allOf, anyOf, or oneOf chain references an ancestor schema, validation enters infinite recursion and exhausts the goroutine stack. The resulting fatal stack overflow cannot be caught with recover and terminates the entire Go process, including unrelated in-flight requests. Document loading accepts the circular reference without warning, which allows the vulnerable condition to reach production. The flaw is tracked as [CWE-674: Uncontrolled Recursion].
Critical Impact
A single malicious request matching a cyclic schema crashes the entire Go process and disrupts all concurrent requests.
Affected Products
- kin-openapi versions prior to 0.149.0
- Go services using openapi3filter for request or response validation
- Applications invoking Schema.visitJSON on user-controlled input
Discovery Timeline
- 2026-10-15 - CVE-2026-100354 published to NVD
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2026-100354
Vulnerability Analysis
The vulnerability resides in the runtime validation paths of kin-openapi. The functions Schema.visitJSON and openapi3filter.decodeValue traverse composite schemas defined with allOf, anyOf, or oneOf. The library accepts documents containing circular references between composite schemas but does not track visited schemas during runtime validation.
When a request or response reaches a schema whose composite chain refers back to an ancestor, the validator recurses indefinitely into the same schema node. Each recursive call consumes goroutine stack frames until the Go runtime raises a fatal stack overflow. Unlike panics, this runtime failure bypasses recover() and terminates the entire process. All concurrent goroutines serving unrelated requests are lost.
Root Cause
The root cause is missing pointer-identity cycle detection in runtime validation code. Document validation implemented stack-based cycle detection in Schema.validate(), but the equivalent protection was absent from visitJSON and decodeValue. The patch introduces a visitedSchemas map[*Schema]struct{} tracking map on schemaValidationSettings that short-circuits revisited nodes.
Attack Vector
An unauthenticated remote attacker sends a crafted request whose body or parameters match a schema path containing a circular allOf, anyOf, or oneOf reference. No authentication or user interaction is required. The attack cost is a single HTTP request, and the impact is immediate termination of the server process.
// Patch: openapi3/schema.go
func (schema *Schema) visitJSON(settings *schemaValidationSettings, value any) (err error) {
if settings.visitedSchemas == nil {
settings.visitedSchemas = make(map[*Schema]struct{})
}
if _, visited := settings.visitedSchemas[schema]; visited {
return nil
}
settings.visitedSchemas[schema] = struct{}{}
defer delete(settings.visitedSchemas, schema)
switch value := value.(type) {
case nil:
// Don't use VisitJSONNull, as we still want to reach 'visitXOFOperations'
Source: GitHub Commit 9245cef
// Patch: openapi3/schema_validation_settings.go
stringFormats map[string]StringFormatValidator
numberFormats map[string]NumberFormatValidator
integerFormats map[string]IntegerFormatValidator
// visitedSchemas provides pointer-identity cycle detection for runtime
// validation, matching the stack-based detection in Schema.validate().
visitedSchemas map[*Schema]struct{}
Source: GitHub Commit 9245cef
Detection Methods for CVE-2026-100354
Indicators of Compromise
- Abrupt process termination with runtime: goroutine stack exceeds or fatal error: stack overflow messages in service logs.
- Service restart events on API gateways or Go services that embed kin-openapi.
- Repeated requests to the same endpoint immediately preceding a crash, originating from a single source.
Detection Strategies
- Inventory Go dependencies using go list -m -json all and flag any github.com/getkin/kin-openapi module below v0.149.0.
- Statically scan loaded OpenAPI documents for allOf, anyOf, or oneOf chains that resolve back to an ancestor $ref.
- Review process supervisor logs (systemd, Kubernetes) for unexpected restart loops tied to API traffic bursts.
Monitoring Recommendations
- Alert on Go runtime stack overflow strings in centralized logging pipelines.
- Track container restart counts and correlate with inbound request patterns per route.
- Monitor 5xx error spikes immediately preceded by a successful request that invoked schema validation.
How to Mitigate CVE-2026-100354
Immediate Actions Required
- Upgrade github.com/getkin/kin-openapi to version 0.149.0 or later across all Go services.
- Rebuild and redeploy all binaries that transitively depend on the library.
- Audit custom OpenAPI documents for cyclic composite schemas and remove unnecessary references.
Patch Information
The fix is available in kin-openapiv0.149.0. The patch adds pointer-identity cycle detection to schemaValidationSettings via the visitedSchemas map, short-circuiting repeated visits to the same *Schema node. See the GitHub Security Advisory GHSA-g8cf-rcjf-c8cf for full details.
Workarounds
- Reject OpenAPI documents containing circular allOf, anyOf, or oneOf references at ingestion time.
- Place a reverse proxy or WAF rule in front of affected services to limit request body size and depth of nested JSON structures.
- Isolate schema validation into a dedicated worker process so a crash does not take down the primary API.
# Upgrade kin-openapi to the patched release
go get github.com/getkin/kin-openapi@v0.149.0
go mod tidy
go build ./...
# Verify the resolved version
go list -m github.com/getkin/kin-openapi
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

