Vulnérabilité dans github.com/getkin/kin-openapi (CVE-2026-100349)
Résumé
Vulnérabilité dans github.com/getkin/kin-openapi (CVE-2026-100349). Risque d'opérations non autorisées ou de divulgation. Exploitable via ValidateResponse. Atténuation : mise à jour vers 0.146.0 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
Summary
ValidateResponse panics on a nil pointer when a spec declares a response header with content instead of schema. doc.Validate() accepts that document, so the crash comes from a spec the library just called valid.
Same class as GHSA-jpcw-4wr7-c3vq, which covered the request-parameter case in v0.144.0; this is the response-header path.
Affects github.com/getkin/kin-openapi <= v0.145.0. Reproduced on master 947498e5a6bd, Go 1.26.
Details
A content-typed response header has headerRef.Value.Schema == nil.
validate_response.go:181 passes it straight through:
if decodedValue, found, err = decodeValue(dec, headerName, sm, headerRef.Value.Schema, headerRef.Value.Required); err != nil {
and req_resp_decoder.go:273 is where it lands:
if len(schema.Value.AllOf) > 0 {
Two things I checked rather than assumed. The response does not need to carry the header; declaring it is enough, and then every call for that operation panics. And the body path is fine, :114 returns early on a nil schema, so this is headers only. The PoC keeps the body case as a control.
PoC
Drop into openapi3filter/ and run:
go test ./openapi3filter/ -run NilSchema -v
package openapi3filter_test
import (
"context"
"io"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/getkin/kin-openapi/openapi3"
"github.com/getkin/kin-openapi/openapi3filter"
"github.com/getkin/kin-openapi/routers"
)
const specBody = `
openap…
Source: NIST National Vulnerability Database NVD GitHub Advisory
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2026-100349 a été découverte dans github.com/getkin/kin-openapi.
Des attaquants peuvent cibler un point d'entrée spécifique comme ValidateResponse à distance pour détourner le produit.
Risque d'opérations non autorisées ou de divulgation. Score CVSS : 7.5/10.
Action : mettez à jour github.com/getkin/kin-openapi vers 0.146.0 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « github.com/getkin/kin-openapi CVE-2026-100349 » sur le site de l'éditeur.
CVE-2026-100349 (github.com/getkin/kin-openapi) — CWE-476 / CVSS v3 7.5
Vecteur d'attaque : distant (réseau) / non authentifié / sans interaction utilisateur
Surface d'attaque : ValidateResponse / content / schema / FAIL
Correctif : 0.146.0 — appliquer immédiatement
Contournement : Use schema on the response header, or skip ValidateResponse for those operations.
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une vulnérabilité (CWE-476) affecte github.com/getkin/kin-openapi. Les attaquants atteignent le code vulnérable via ValidateResponse sans authentification.
Consultez l'avis de l'éditeur pour les versions affectées de github.com/getkin/kin-openapi. Surface d'attaque : ValidateResponse / content / schema / FAIL.
Gravité : Élevée (CVSS 7.5/10). Risque d'opérations non autorisées ou de divulgation.
Mettre à jour vers 0.146.0.
Contournement : Use schema on the response header, or skip ValidateResponse for those operations.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
1Identify exposure identify
grep -r 'github.com/getkin/kin-openapi' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
github.com/getkin/kin-openapiを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
Use `schema` on the response header, or skip `ValidateResponse` for those operations.パッチが適用されるまでの応急処置として、Use
schemaon the response header, or skipValidateResponsefor those operations. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3Apply patch patch
Upgrade github.com/getkin/kin-openapi to 0.146.0ステージング環境で 0.146.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
Références
- REDHAT Red Hat
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com