Skip to main content
Vulnerability Database/CVE-2026-100348

CVE-2026-100348: kin-openapi Use After Free Vulnerability

CVE-2026-100348 is a use after free flaw in kin-openapi that causes nil pointer dereference when loading malicious OpenAPI documents. This article covers technical details, affected versions, and mitigation strategies.

Published:

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-100348 Overview

CVE-2026-100348 is a nil pointer dereference vulnerability in kin-openapi, a Go library for parsing and validating OpenAPI documents. Versions prior to 0.145.0 allow an attacker-controlled OpenAPI document to crash the loading process. The openapi3.Loader dereferences a nil SchemaRef.Value while resolving a self-referential additionalProperties JSON Reference. The vulnerable code path is reached through LoadFromData, LoadFromFile, or LoadFromURI before document validation runs. The flaw is tracked as CWE-476: NULL Pointer Dereference.

Critical Impact

Any Go service that loads untrusted OpenAPI documents using affected versions of kin-openapi can be panicked remotely, resulting in availability loss for the affected process.

Affected Products

  • kin-openapi Go module versions prior to 0.145.0
  • Applications using openapi3.Loader with LoadFromData, LoadFromFile, or LoadFromURI
  • Downstream Go services that accept user-supplied OpenAPI specifications

Discovery Timeline

  • 2026-10-15 - CVE-2026-100348 published to NVD
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2026-100348

Vulnerability Analysis

The defect lives in the schema reference resolution logic inside openapi3/loader.go. When the loader walks a JSON Reference pointing at an additionalProperties member, it reaches resolveComponent before the parsed document is validated. At this stage, intermediate SchemaRef entries can still hold a nil Value field. The affected branch accessed c.Value.AdditionalProperties directly without a nil guard, triggering a runtime panic in the Go process. Resolved additionalProperties schemas and ordinary recursive schemas do not reach the vulnerable branch, so exploitation requires a specifically shaped self-referential reference.

Root Cause

The root cause is missing nil validation on the SchemaRef.Value pointer prior to field access during reference traversal. A self-referential JSON Reference whose target is its own additionalProperties member leaves the intermediate schema value unresolved. Dereferencing the pointer at that point produces a Go runtime panic.

Attack Vector

An attacker supplies a crafted OpenAPI document to any application that calls LoadFromData, LoadFromFile, or LoadFromURI. No authentication or user interaction is required when the loader endpoint is network-exposed. Successful exploitation panics the loader and terminates the goroutine or process handling the request, producing a denial-of-service condition.

go
// Patch excerpt from openapi3/loader.go — adds nil guard on SchemaRef.Value
// Special case due to multijson
case *SchemaRef:
    if pathPart == "additionalProperties" {
        if s := c.Value; s != nil {
            if ap := s.AdditionalProperties.Has; ap != nil {
                cursor = *ap
            } else {
                cursor = s.AdditionalProperties.Schema
            }
        }
        attempted = true
    }

Source: GitHub commit 88aa64c

Detection Methods for CVE-2026-100348

Indicators of Compromise

  • Unexpected Go runtime error: invalid memory address or nil pointer dereference panics originating in kin-openapi/openapi3 stack frames
  • Service restarts or crash loops correlated with inbound OpenAPI document uploads or URL fetches
  • HTTP 5xx responses from endpoints that parse user-supplied OpenAPI specs

Detection Strategies

  • Inventory Go binaries and container images for github.com/getkin/kin-openapi module versions below 0.145.0 using go list -m all or SBOM tooling
  • Inspect application logs for panic stack traces referencing resolveComponent or loader.go
  • Review ingress logs for OpenAPI documents containing $ref values pointing to #/.../additionalProperties

Monitoring Recommendations

  • Alert on repeated process restarts of services that expose OpenAPI loading endpoints
  • Track dependency drift in CI pipelines to flag any build still pinning a vulnerable kin-openapi version
  • Capture and triage crash dumps from Go services that ingest third-party API descriptors

How to Mitigate CVE-2026-100348

Immediate Actions Required

  • Upgrade github.com/getkin/kin-openapi to version 0.145.0 or later across all Go modules
  • Rebuild and redeploy any binaries or container images that embed the vulnerable library
  • Restrict ingestion of OpenAPI documents to authenticated and trusted sources until patched

Patch Information

The fix is included in the kin-openapi v0.145.0 release and committed in 88aa64c7cbd03ecadbb419c473bdcaa8b0124c6b. Additional context is published in GitHub Security Advisory GHSA-mh7x-f8wq-4jhx.

Workarounds

  • Validate or schema-check inbound OpenAPI documents before passing them to openapi3.Loader
  • Reject documents that contain $ref entries targeting their own additionalProperties member
  • Wrap loader invocations in recover() to contain panics until the dependency is upgraded
bash
# Upgrade the dependency and verify the resolved version
go get github.com/getkin/kin-openapi@v0.145.0
go mod tidy
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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.