Repository navigation
fix(deps): update module github.com/getkin/kin-openapi to v0.149.0 [security] - #18
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
ℹ Artifact update noticeFile name: go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
renovate
Bot
deleted the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
May 29, 2025 03:11
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
from
May 29, 2025 04:57
de34d2b to
5c6266f
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
from
July 11, 2025 02:45
5c6266f to
344b69e
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
from
August 10, 2025 14:21
344b69e to
ab75605
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
from
October 9, 2025 09:32
ab75605 to
02dc5dc
Compare
Contributor
Author
ℹ️ Artifact update noticeFile name: go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
2 times, most recently
from
February 21, 2026 00:55
02dc5dc to
38dfd35
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
2 times, most recently
from
March 30, 2026 17:51
38dfd35 to
6aa83b9
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
2 times, most recently
from
May 5, 2026 21:50
6aa83b9 to
29678eb
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
from
June 3, 2026 05:32
2597cd3 to
f38857e
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
from
June 3, 2026 15:39
f38857e to
b8a896c
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
2 times, most recently
from
July 2, 2026 02:46
b8a896c to
6cfe4fd
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
from
July 28, 2026 06:04
6cfe4fd to
f4429d2
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
2 times, most recently
from
August 3, 2026 20:38
f4429d2 to
f4cbcf5
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-getkin-kin-openapi-vulnerability
branch
from
August 18, 2026 23:26
f4cbcf5 to
d075b43
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
v0.112.0→v0.149.0Improper Handling of Highly Compressed Data (Data Amplification) in github.com/getkin/kin-openapi/openapi3filter
CVE-2025-30153 / GHSA-wq9g-9vfc-cfq9
More information
Details
Summary
When validating a request with a multipart/form-data schema, if the OpenAPI schema allows it, an attacker can upload a crafted ZIP file (e.g., a ZIP bomb), causing the server to consume all available system memory.
Details
The root cause comes from the ZipFileBodyDecoder, which is registered automatically by the module (contrary to what the documentation says.
PoC
To reproduce the vulnerability, you can use the following OpenAPI schema:
And this code to validate the request (nothing fancy, it basically only calls the
openapi3filter.ValidateRequestfunction`):We also need to create a zip bomb. This command will create a 4.7GB file and compress it to to 4.7MB zip archive:
Run the PoC provided, and upload the zip bomb with
curl localhost:8080/ -F file="@/tmp/bomb.zip;type=application/zip" -v.Observe the memory consumption of the test server during and after the upload (it jumped to a bit over 22GB in my testing, with only a 4.7MB input file, you can reduce the size of the generated file to not kill your test machine when reproducing.)
Impact
An attacker can trigger an out-of-memory (OOM) condition, leading to server crashes or degraded performance.
It seems to only be exploitable if the OpenAPI schema allows for multipart upload.
Remediation
I see at least 2 potential fixes/improvements:
ZipFileBodyDecoderto enforce a maximum size of the decompressed archive and bailout as soon as it's reached (probably with a small default value and allow the users to configure it through the input options ?)Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
kin-openapi: ValidationHandler.Load() Fail-Open Authentication Bypass via NoopAuthenticationFunc Default
GHSA-r277-6w6q-xmqw
More information
Details
Summary
ValidationHandler.Load()ingetkin/kin-openapisilently replaces a nilAuthenticationFuncwithNoopAuthenticationFunc, which always returnsnilwithout performing any credential check. Because this substitution happens unconditionally when the caller omits the field, every OpenAPIsecurityrequirement declared in the spec is silently satisfied for unauthenticated requests. An unauthenticated remote attacker can reach handlers for routes whose OpenAPI operation requires an API key, OAuth token, or any other security scheme if the application relies onValidationHandleras its enforcement middleware.Details
ValidationHandleris an HTTP middleware exported byopenapi3filterthat validates incoming requests and responses against a loaded OpenAPI specification. ItsLoad()method initialises default fields before the handler begins serving:NoopAuthenticationFuncis defined as:It always returns
nil, meaning every security scheme check it handles is automatically approved.When a request arrives,
ServeHTTP→before→validateRequestassembles aRequestValidationInputwith the currentAuthenticationFunc(now the no-op) injected intoOptions:Inside
ValidateRequest, each security requirement callsoptions.AuthenticationFunc:Because
fis the no-op (notnil), theErrAuthenticationServiceMissingguard is never triggered andf(...)returnsnil, clearing the security requirement. Control then proceeds to the protected handler (validation_handler.go:61-62).The critical contradiction is that callers who use
ValidateRequestdirectly with a nilAuthenticationFuncget fail-closed behavior (ErrAuthenticationServiceMissing), while callers who use the higher-levelValidationHandlerwith a nilAuthenticationFuncget fail-open behavior. Since omittingAuthenticationFuncis the natural default, the majority of real-world integrations are vulnerable.Affected source file and line:
openapi3filter/validation_handler.go:47–49(commit30e2923, tagv0.143.0).PoC
Environment
Step 1 — Build the Docker image
From the repository root (parent of
vuln-001/):The
Dockerfilecopies the localkin-openapisource into/kin-openapi/inside the image and builds a Go binary (/poc-binary) frommain.go. Thego.modinside the image uses areplacedirective pointing to/kin-openapi, so no network access to the Go module proxy is required.Step 2 — Run the container
Step 3 (alternative) — Use the Python helper
What the PoC does
main.gocreates a temporary OpenAPI 3.0 spec that declaresGET /secretas protected by anapiKeysecurity scheme:It then constructs a
ValidationHandlerwithout settingAuthenticationFunc, callsLoad(), and sends a request with noX-Api-Keyheader:Expected (vulnerable) output
The contrast block confirms fail-closed behavior when
ValidateRequestis called directly. The exploit block confirms fail-open behavior throughValidationHandler. Status 200 andSECRET_DATAare returned without any credential.Remediation patch
After this change, a nil
AuthenticationFuncpropagates intoValidateRequest, which returnsErrAuthenticationServiceMissingand rejects the request. Callers who genuinely want to skip authentication can still opt in explicitly:h.AuthenticationFunc = openapi3filter.NoopAuthenticationFunc.Impact
This is an authentication bypass vulnerability (CWE-287). Any application that:
openapi3filter.ValidationHandleras its HTTP middleware, andsecurityrequirements in its OpenAPI specification, andAuthenticationFunc,is fully exposed. An unauthenticated remote attacker can send requests to any protected endpoint without supplying credentials; the middleware accepts the request and forwards it to the underlying handler as if authentication had succeeded.
Affected parties include all Go services that adopt
ValidationHandleras a drop-in validation layer and rely on OpenAPIsecuritydeclarations for access control without adding a separate authentication layer upstream (e.g., an API gateway or reverse proxy). Because the insecure behavior is the default, developers following the "getting started" path are affected without any additional mistake.The confidentiality and integrity of data behind secured endpoints are both at high risk. Availability is not directly affected by this vulnerability.
Reproduction artifacts
Dockerfilepoc.pySeverity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
kin-openapi openapi3filter: unauthenticated nil-pointer panic when validating a request against a
contentparameter whose media type has no schemaCVE-2026-73502 / GHSA-jpcw-4wr7-c3vq
More information
Details
github.com/getkin/kin-openapi<= 0.143.0(introduced inv0.2.0, PR #90, 2019-05-07; reproduced onHEAD30e2923)Summary
openapi3filter.ValidateRequestcontains a NULL-pointer-dereference denial of service: any unauthenticated client can crash the request-validation path with a single HTTP request. When an operation declares acontentparameter (as opposed to aschemaparameter) whose media type object has noschema, request validation dereferences that missing schema and panics. The document is legal under the OpenAPI Specification — kin-openapi's owndoc.Validate()accepts it — and the defect affects both OpenAPI 3.0.x and 3.1.x. Depending on how the library is wired into the server (see Impact), this ranges from a per-request abort with unbounded panic-log growth to a full remote process crash.Details
The decoder used for
contentparameters when no customParamDecoderis configured (the library default),defaultContentParameterDecoder, dereferences the media-type schema without a nil check.openapi3filter/req_resp_decoder.go, around line 197:The function guards
param.Content == nil,len(content) != 1, andmt == nil, but nevermt.Schema == nil.Why a schema-less content parameter is legal (so the sink is reachable —
doc.Validate()returns no error), in both 3.0.x and 3.1.x:openapi3/parameter.go—Parameter.Validateonly enforces exactly one ofschemaXORcontent; a parameter withcontent(and noschema) satisfies it.openapi3/media_type.go—MediaType.Validatevalidates the schema only when it is non-nil, so an absent schema is not a validation error.Call path to the panic:
Authentication note:
ValidateRequestvalidates security before parameters, but the panic is reachable without credentials whenever the target operation declares no security requirement, or when noAuthenticationFuncis configured (it is opt-in). A single unauthenticated operation anywhere in the served spec is sufficient. If an operation does declare security and a rejectingAuthenticationFuncis wired, that request is rejected before decoding.PoC
Reproduced end-to-end against
HEAD(30e2923) with a realnet/httpserver and a stockhttp.Client.1. Minimal OpenAPI 3.0.3 document (legal —
doc.Validate()passes). Thecfgquery parameter usescontentwith anapplication/jsonmedia type that has noschema:2. A complete, self-contained program. Drop this into a directory inside a checkout of
github.com/getkin/kin-openapiand run it withgo run .. It loads the document above, assertsdoc.Validate()accepts it (proving reachability), serves it behind request validation exactly as the recommended middleware does, and sends one unauthenticatedGET /c?cfg=1:3. Observed result — the request goroutine panics inside validation, and the client's
http.Getreturns an EOF:Swapping the media type for one that carries a schema (
application/json: {schema: {type: object}}) makes the same request return a clean400instead of panicking, confirming the missing schema is the cause.Impact
This is an unauthenticated remote denial of service (CWE-476) against any service that validates incoming requests with
openapi3filterand serves a spec containing at least onecontentparameter whose media type lacks aschema.The precise consequence depends on which goroutine runs the panic and whether a
recover()covers it:net/http?net/http(incl.openapi3filter.ValidationHandler)http: panic servinglog growth.ValidateRequeston an app-spawned goroutine (fan-out,errgroup, async pre-check)recover().net/httphost (fasthttp adaptor, gRPC-gateway shim, CLI, offline/batch spec validator)This is why the suggested CVSS uses
A:L(Base 5.3): under the recommended synchronousnet/httpwiring the panic is recovered per-connection. Reviewers may reasonably raise it toA:H(Base 7.5) for the spawned-goroutine and non-net/httpintegrations, where a single request kills the process.Remediation (suggested)
Add a
mt.Schema == nilguard mirroring the existingmt == nilguard, so a schema-less content parameter yields a clean validation error instead of a panic:The
unmarshalclosure immediately below already tolerates a nil schema (it checksparamSchema != nil), so returning early on nilmt.Schemais consistent with surrounding intent.Workarounds for consumers, pending a patch:
contentparameter in served specs declares aschema, or reject such specs at load time.ParamDecoderthat guardsmt.Schema == nil.recover()— especially if validation runs off the request goroutine or on a non-net/httphost.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
kin-openapi openai3filter: nil-pointer panic in ConvertErrors on malformed multipart/form-data body enables unauthenticated DoS
CVE-2026-76905 / GHSA-mmfr-pmjx-hw9w
More information
Details
Summary
A nil-pointer dereference in
openapi3filter.ConvertErrorslets any unauthenticated client crash a server with a single HTTP request. When an application validates amultipart/form-datarequest body and renders the resulting validation error through the library-providedValidationErrorEncoder/ConvertErrorshelpers, a malformed scalar form field (e.g. a non-numeric value for anintegerproperty) produces an error shape thatconvertParseErrordereferences without a nil check. The handler goroutine panics, causing a denial of service.application/jsonrequest bodies are not affected — the bug is specific tomultipart/form-data.Details
The panic is in
convertParseError, atopenapi3filter/validation_error_encoder.go:119-120(still present onmasterat the time of writing):The comparison
e.Parameter.In == "query"assumese.Parameteris non-nil. It is reached whenever both of the following hold:e.Parameter == nil. A*RequestErrorcarries eitherParameter(parameter errors) orRequestBody(body errors), never both.ValidateRequestBodybuilds body errors with onlyRequestBodyset, leavingParameternil — seevalidate_request.go:326-332.innerErr.Causeis itself a*ParseError(aParseErrornested inside aParseError), so the type assertion on line 119 succeeds and execution reaches thee.Parameter.Indereference on line 120.The only default code path that satisfies both conditions is the multipart body decoder, which wraps a failed part's
*ParseErrorinside another*ParseErroratreq_resp_decoder.go:1549and:1558:Why other paths do not reach the dereference:
RequestError.Errshape.Causeis*ParseError?e.Parametermultipart/form-dataage=notanumber)*ParseErrorwrapping a*ParseErrornilapplication/json*ParseErrorwhose.Causeis anencoding/jsonerrornilapplication/json*openapi3.SchemaError(routed toconvertSchemaError, never reachesconvertParseError)nilquery/pathparams*ParseErrorwrapping a*ParseErrorNote that the sibling
"path"branch two lines above (line 108) already guards correctly withe.Parameter != nil; the"query"branch simply omits the same guard.Recommended fix. Add the missing nil guard to the condition:
When
e.Parameter == nilthe innerifis skipped and control falls through to the existingreturn &ValidationError{Status: http.StatusBadRequest, Title: innerErr.Reason}at line 127-130 — a correct400 Bad Request. I verified that applying only this one-line guard stops the panic and returns*ValidationError{Status: 400}.Minor follow-up worth including in the same change: for the multipart nested
*ParseError, the outerParseError.Reasonis empty, so the fallbackTitle: innerErr.Reasonyields a400with an emptyTitle. The descriptive text lives ininnerErr.Error()(e.g."path age: value notanumber: an invalid integer: invalid syntax"). Prefer a non-empty fallback:PoC
Verified against revision
98d956447b64eaa10d3570a80b3be1a2849945f1(also reproducible on currentmaster), Go 1.25.0.1. Spec — one operation accepting a
multipart/form-databody with a non-string scalar (integer) property:2. Program — validate a request whose
agepart is non-numeric, then convert the error the way a typical error-rendering middleware does:3. Observed output (
go run .):The panic is at exactly
validation_error_encoder.go:120— the unguardede.Parameter.Indereference.Control (confirms JSON is not a vector): repeating the setup with an
application/jsonbody and either a malformed body ({"age":) or a wrong-type body ({"age": "notanumber"}) returns fromConvertErrorsnormally, with no panic. Only themultipart/form-datapath crashes.In a real HTTP server,
ConvertErrors/ValidationErrorEncoder.Encoderuns inside the request handler, so the panic aborts the in-flight request (connection reset / 500) and, without arecover()in the middleware chain, is trivially repeatable.Impact
github.com/getkin/kin-openapi/openapi3filterthat (1) exposes an endpoint accepting amultipart/form-datarequest body with at least one non-string scalar property (integer/number/boolean), and (2) renders validation errors through the library's ownValidationErrorEncoderorConvertErrorshelpers. These are the library's advertised error-rendering helpers, so this is a realistic default integration.recover()boundary in the application's middleware, the request is aborted; sustained requests deny service. Confidentiality and integrity are not affected.application/jsonbodies (verified above), applications that do not useConvertErrors/ValidationErrorEncoderto format errors, or applications that wrap handlers in arecover()(which converts the crash into a handled 500 but still prevents normal error rendering).Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
kin-openapi: Unauthenticated panic (DoS) in openapi3filter legacy router via non-canonical/unsupported HTTP method on a static path
CVE-2026-100347 / GHSA-fh4f-47mf-f2gj
More information
Details
Summary
The
openapi3filter.ValidationHandler(the exported, documented request-validation middleware) hard-wires the legacy router (routers/legacy). That router matches the incoming request method verbatim against a trie built exclusively from upper-cased canonical HTTP methods. A request carrying a method token that is not one of the 9 standard methods — a legitimate-but-unsupported token such asPROPFIND, or a non-canonical case variant such as lowercaseget— misses the trie, leavesroute == nil, and for an existing static path falls through toPathItem.GetOperation(method), whosedefault:case callspanic(...). The panic fires inside route resolution, before any authentication runs. This is an unauthenticated, remotely triggerable denial of service (recovered per-connection panic + unbounded error-log growth).Root Cause
openapi3filter/validation_handler.go:39—ValidationHandler.Load()always constructslegacyrouter.NewRouter(doc); there is no alternative router option on this path.routers/legacy/router.go:109— the request method is used verbatim (method, url := req.Method, ...); there is no canonicalization or rejection of unknown method tokens.routers/legacy/router.go:69-70— the trie is populated withstrings.ToUpper(method)keys taken frompathItem.Operations()(canonicalhttp.Method*constants only).routers/legacy/router.go:141—root.Match(method + " " + remainingPath)misses for a non-canonical/unsupported method →route == nil.routers/legacy/router.go:146-150— in theroute == nilblock,doc.Paths.Value(path)returns non-nil for an existing static path, and control reachespathItem.GetOperation(method).openapi3/path_item.go:174—GetOperation'sswitch methodhas no matching case →default: panic(fmt.Errorf("unsupported HTTP method %q", method)).Impact
An unauthenticated attacker sends a single request with a non-standard HTTP method token to any existing static path. The handler goroutine panics; Go's
net/httprecovers the panic per connection (process survives), aborts the connection (client sees a reset / 500), and logs a full stack trace. Repeated requests cause connection churn and unboundedhttp: panic servinglog growth, and the request never reaches authentication. Availability impact (A:L) under the default synchronousValidationHandlermiddleware; on non-net/http hosts or when reached on an application goroutine the ceiling is a full crash.Proof of Concept
Serve any spec with a static path (e.g.
/ping) behindopenapi3filter.ValidationHandler, then:Reproduced end-to-end against a real
net/http.Server+ValidationHandler:PROPFIND /pingand lowercaseget /pingboth abort the connection with a panic atpath_item.go:174(stack:GetOperation<-legacy.FindRouterouter.go:150 <-ValidationHandler.validateRequestvalidation_handler.go:84); the process stays alive and subsequentGET /pingreturns 200.Attack Chain
PROPFIND /ping HTTP/1.1(any known static path). Guard: net/http method validation. Bypass proof: net/http accepts any valid HTTP token as a method —PROPFINDand lowercasegetboth reach the handler.legacy/router.go:141root.Match("PROPFIND /ping"). Guard: trie match. Bypass proof: trie holds only upper-cased canonical methods → miss →route == nil.route == nilblock:router.go:146doc.Paths.Value("/ping")→ non-nil for an existing static path (exact map lookup). Guard:pathItem == nilcheck (l.147). Bypass proof: static path exists → not nil → proceeds.router.go:150pathItem.GetOperation("PROPFIND")→path_item.go:174default: panic(...).Bypass Evidence
PROPFINDand lowercasegetboth reached the handler and panicked.FindRouteentry andGetOperation;req.Methodis used verbatim (router.go:109).git show v0.144.0:openapi3/path_item.goshowspanic(...)at line 174;git show v0.144.0:routers/legacy/router.goshows verbatim method use and the unguardedGetOperationcall.git log v0.144.0..HEADon these files is empty (no post-tag fix).Scoping Note
The panic requires the request path to be an exact static (non-templated) key in the served spec. A concrete path against a
/{id}template returns a clean 500 (not a panic), becausePaths.Valueis an exact map lookup. Static paths (/health,/login,/version,/metrics,/ping,/) are ubiquitous in real specs and discoverable from public specs/standard endpoints, so a vulnerable target almost always exists. This makes the finding arguably broader than existing panic advisories, as it needs no special spec construct — any static path suffices.Affected Versions
<= 0.144.0(present on the latest release tag v0.144.0; long-standing; no patched version).Suggested Fix
In the legacy router, canonicalize/validate the request method before route resolution and return
ErrMethodNotAllowed/ErrPathNotFoundfor unknown methods, or makePathItem.GetOperationreturn an error (nil) for unrecognized methods instead of callingpanic.Reported by zx (Jace) — GitHub: @manus-use
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
kin-openapi spec loader panics on a self-referential additionalProperties $ref (nil-pointer DoS)
CVE-2026-100348 / GHSA-mh7x-f8wq-4jhx
More information
Details
The defect
Confirmed at HEAD (f0407d5, v0.144.0). openapi3/loader.go, inside resolveComponent's drill closure (around line 455), the case *SchemaRef branch for pathPart == "additionalProperties" dereferences c.Value.AdditionalProperties with no nil-check on c.Value:
When a $ref fragment drills through .../additionalProperties of a schema whose Value is still nil (a pure, not-yet-resolved $ref, or a self-reference resolved before its own Value is set), c.Value is nil and the .AdditionalProperties access panics.
Input and attacker
A tiny crafted OpenAPI document, one schema, no external refs, no network:
Attacker model: any service or tool that loads an untrusted spec via the default openapi3.Loader (LoadFromData / LoadFromFile / LoadFromURI), e.g. a spec registry, an API-management platform ingesting user specs, a linter, or a converter. It crashes during LOAD (ResolveRefsIn), before Validate.
Verification level
EXECUTED with negative controls (agent-run go test at HEAD f0407d5, including yesterday's security merge; the bug is still present). The full stack pins LoadFromData:196 -> ResolveRefsIn:274 -> resolveSchemaRef:1048 -> resolveComponent:485 -> drill:439 -> :455, propagating to main(); no recover() in loader.go/schema.go (grep + trace). Two negative controls stay clean: drilling additionalProperties of a resolved schema loads fine (the existing TestIssue376 happy path), and a normal recursive schema loads fine, so the nil Value is specifically the cause. I independently re-confirmed at HEAD that loader.go:455 dereferences c.Value.AdditionalProperties with no nil-check on c.Value. NOT verified: I did not enumerate every consumer's recover posture.
Suggested fix
Add if c.Value == nil { break } (fall through to the nil-safe drillIntoField) before touching c.Value.AdditionalProperties. One line.
Also cleared (stated, not claimed)
The allOf/anyOf $ref diamond does not blow up: Schema.validate threads its stack through the return and never pops it, acting as a global pointer-keyed visited-set (executed N=10..30, microseconds). External-ref SSRF/path-traversal is blocked by default (IsExternalRefsAllowed=false); the known custom-ReadFromURIFunc bypass is the already-banked downstream oasdiff item.
Advisory-source note
Five-source enumeration: every kin-openapi advisory (CVE-2025-30153 plus the five fresh July-2026 GHSAs) is in openapi3filter (request validation); this finding is in the openapi3 loader, untouched by that systematic reporter and flagged un-analyzed by the prior oasdiff scout. Not contested on the loader surface as of today (a systematic hunter could pivot, so it decays; submit reasonably promptly).
Dedup
Dedup gate clean: no kin-openapi loader verdict in COVERED-INDEX, DISCLOSURE-INDEX or SCOUT-EXCLUDE (the one DISCLOSURE-INDEX hit is report #313, the downstream oasdiff, a different repo/lane).
Tooling
AI assistance was used while investigating. The panic is executed-verified with negative controls (a one-schema self-referential additionalProperties $ref crashes LoadFromData while a resolved additionalProperties and a normal recursive schema load fine), and I confirmed at HEAD that loader.go:455 dereferences c.Value.AdditionalProperties with no nil-check on c.Value, on a load path with no recover.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
kin-openapi: YAML NaN/Inf Values Bypass Built-in Guards and Panic via OAS 3.1 Validation Path
CVE-2026-100352 / GHSA-rj39-cv6w-8wv7
More information
Details
Summary
kin-openapi guards against
NaNandInfvalues in its built-in schema visitor (visitJSON) by returningErrSchemaInputNaN/ErrSchemaInputInfwhen afloat64input violates those constraints. For OAS 3.1 specs, however,Schema.VisitJSONroutes throughuseJSONSchema2020, which hands the value directly tosanthosh-tekuri/jsonschema/v6v6.0.2 without applying the same guard.Inside
jsonschema/v6v6.0.2,numValidatebuilds a*big.Ratfrom the input viabig.Rat.SetString(fmt.Sprintf("%v", v)). ForNaN/Infthis parse fails silently and returnsnil.numValidatethen dereferences the nil*big.Rat(inmath/big.(*Rat).Cmp), producing a Go runtime panic.An attacker delivers this by sending an HTTP request with
Content-Type: application/yaml(orapplication/x-yaml) and a YAML body containing.nan,.inf, or-.inf. TheYamlBodyDecoderdecodes those tokens intomath.NaN()/math.Inf(±1)(standard YAML 1.2 behavior), and they propagate to the unguardeduseJSONSchema2020path whenever the schema declares a numeric constraint (minimum,maximum,exclusiveMinimum,exclusiveMaximum, ormultipleOf).Details
Root Cause
The built-in visitor
visitJSONatopenapi3/schema.go:1968guards NaN/Inf explicitly:For OAS 3.1 specs,
VisitJSONdispatches touseJSONSchema2020(openapi3/schema_jsonschema_validator.go:204), which contains no such guard:jsonSchemaValidator.validatecallsjsonschema/v6.Schema.Validate(line 146), which reachesnumValidatein v6.0.2. There,big.Rat.SetString(fmt.Sprintf("%v", v))returns(nil, false)forNaN/Inf, and the code dereferences thenil*big.RatinRat.Cmp, causing the panic.Proof of Concept
Environment
v0.144.0, commitf0407d5)Spec
Minimal OAS 3.1 spec (
spec.yaml) declaring a YAML body with a numeric constraint: