GHSA-h9mw-h4qc-f5jf: kubernetes-graphql-gateway: GraphQL Endpoint Vulnerable to Authenticated Denial-of-Service via Unrestricted Query Execution
Noroxi değerlendirmesi
Öncelik: İzleyin (aksiyon skoru 26/100)
- İzlediğimiz kaynaklarda (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) herkese açık istismar kodu ya da sahada sömürü kaydı yok.
- İnternetten erişebilen herkes tetikleyebilir. Düşük yetkili bir hesap yeterli. Kullanıcının bir şey yapması gerekmez. Özel bir koşul gerekmez; tekrarlanabilir.
- Düzeltilmiş sürüm: github.com/platform-mesh/kubernetes-graphql-gateway (Go) 1.2.9.
Şimdilik düşük öncelik. github.com/platform-mesh/kubernetes-graphql-gateway (Go) 1.2.9 ya da daha yeni sürüme yükseltin.
Kaydın verisinden otomatik üretilir: CVSS (NVD ve CNA), CISA KEV ve SSVC, FIRST EPSS, istismar kaynakları, düzeltme sürümleri. Nasıl hesaplıyoruz
Birincil kaynaklar: OSV
**CVSS 6.5 Medium** — The GraphQL API served by kubernetes-graphql-gateway is vulnerable to Denial-of-Service (DoS) attacks due to a complete absence of query resource controls (depth limiting, complexity analysis, response size capping, and rate limiting). An authenticated attacker can craft queries that force the server to compute and serialize multi-megabyte responses, consuming significant CPU, memory, and network bandwidth. Repeated requests can exhaust server resources and degrade or deny service to legitimate users. > **Note:** A previous version of this advisory (based on pre-v1 code) documented an unauthenticated attack surface via an HTTP GET method bypass in the former `registry.go`. That bypass has been removed in v1 — all requests now require a Bearer token. The CVSS score has been adjusted from 7.5 to 6.5 accordingly (Privileges Required: None → Low). CWE-306 (Missing Authentication for Critical Function) no longer applies. ## Root Cause The kubernetes-graphql-gateway uses the `graphql-go/graphql` library (v0.8.1) with the `graphql-go/handler` HTTP handler. The handler is instantiated in `gateway/gateway/graphql/graphql.go` with only cosmetic configuration — no resource limits: ```go // gateway/gateway/graphql/graphql.go — CreateHandler() func (s *GraphQLServer) CreateHandler(schema *graphql.Schema) *GraphQLHandler { graphqlHandler := handler.New(&handler.Config{ Schema: schema, Pretty: s.config.Pretty, Playground: s.config.Playground, GraphiQL: s.config.GraphiQL, }) return &GraphQLHandler{ Schema: schema, Handler: graphqlHandler, } } ``` The `handler.Config` struct does not include `MaxDepth`, `MaxComplexity`, `MaxResponseSize`, or any equivalent fields. Neither the `graphql-go/handler` nor the underlying `graphql-go/graphql` library provides built-in query depth or complexity analysis. The application configuration (`gateway/gateway/config/config.go`) has no fields for resource limits: ```go // gateway/gateway/config/config.go — GraphQL config type GraphQL struct { Pretty bool Playground bool GraphiQL bool } ``` No rate limiting, throttling, or request size controls exist anywhere in the codebase. ## Authentication Model All requests pass through the HTTP handler in `gateway/http/http.go`, which extracts a Bearer token and injects it into the request context: ```go // gateway/http/http.go — Token extraction (applied to all methods) s.Handle("/api/clusters/{clusterName}", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { clusterName := r.PathValue("clusterName") authHeader := r.Header.Get("Authorization") token := strings.TrimPrefix(authHeader, "Bearer ") ctx := utilscontext.SetToken(r.Context(), token) ctx = utilscontext.SetCluster(ctx, clusterName) c.Gateway.ServeHTTP(w, r.WithContext(ctx)) })) ``` The token is enforced at the Kubernetes API layer via `gateway/gateway/roundtripper/bearer.go`, which returns HTTP 401 for requests without a valid token. However, the GraphQL execution engine (query parsing, schema validation, introspection) still runs **before** the Kubernetes API is contacted — meaning authenticated users can trigger expensive operations that consume server resources without hitting the K8s API at all. ## Attack Vectors ### 1. Nested Introspection Field Expansion The GraphQL schema contains 3,508 types (Kubernetes resources + platform CRDs). Introspection meta-fields (`__schema`, `__type`) allow recursive field expansion. Each additional nesting level multiplies the response size exponentially. A single full introspection query generates ~5.2 MB of response data in ~1.15s. ### 2. Parallel Request Amplification Without rate limiting, an authenticated attacker can issue many concurrent expensive queries. 5 parallel requests generate ~18.6 MB total response in under 4 seconds with no throttling. At scale (e.g. 999 concurrent requests), the backend becomes unresponsive and returns 503 to all users. ### 3. Subscription Resource Exhaustion The `HandleSubscription()` method in `gateway/gateway/graphql/graphql.go` processes SSE (Server-Sent Events) subscription requests. A malicious authenticated client can open many subscription channels simultaneously, holding server connections and memory indefinitely: ```go // gateway/gateway/graphql/graphql.go — HandleSubscription() subscriptionChannel := graphql.Subscribe(subscriptionParams) for res := range subscriptionChannel { // ... marshal and flush indefinitely ... } ``` There is no limit on the number of concurrent subscriptions, no idle timeout, and no per-client connection cap. ### 4. Deep Query Execution Authenticated users can submit arbitrarily deep and complex GraphQL queries. The GraphQL execution engine processes the full query — consuming CPU and memory for schema validation, field resolution, and error/response formatting — before any Kubernetes API authorization is checked. The request handling in `gateway/gateway/endpoint/endpoint.go` passes directly to the handler with no query guards: ```go // gateway/gateway/endpoint/endpoint.go — ServeHTTP() func (e *Endpoint) ServeHTTP(w http.ResponseWriter, r *http.Request) { if e.handler == nil || e.handler.Handler == nil { http.Error(w, "Endpoint not ready", http.StatusServiceUnavailable) return } if r.Header.Get("Accept") == "text/event-stream" { e.graphqlServer.HandleSubscription(w, r, e.handler.Schema) return } e.handler.Handler.ServeHTTP(w, r) } ``` ## Impact - **Availability (High):** Service denial achievable — concurrent expensive queries cause backend to become unresponsive (503 for all users). With 3,508 types and no depth limits, each introspection query generates a ~5.2 MB response. The absence of rate limiting, query complexity controls, and response size caps allows an authenticated attacker to exhaust server CPU, memory, and bandwidth. - **Confidentiality (None):** Information disclosure is covered in a separate finding. - **Integrity (None):** No data modification possible. ## Affected Components - `gateway/gateway/graphql/graphql.go` — Handler creation with no resource limits; subscription handler with no connection limits - `gateway/gateway/endpoint/endpoint.go` — Direct passthrough to handler, no query depth/complexity middleware - `gateway/gateway/config/config.go` — No configuration fields for resource limits - `gateway/http/http.go` — No rate limiting middleware - `graphql-go/graphql` library — No built-in depth/complexity limiting - `graphql-go/handler` — No resource limit configuration options ## Recommendations 1. **Disable Introspection in Production** — As a defense-in-depth measure, disable introspection in non-development environments. This removes the highest-cost query path. If GraphiQL/Playground must remain accessible for development, gate it behind an environment flag. 2. **Implement Query Depth and Complexity Limiting** — Implement middleware that parses the query AST and rejects queries exceeding configurable thresholds before execution. Recommended maximum depth: 10 levels. Assign cost values to fields and enforce a maximum query cost budget — introspection meta-fields (`__schema`, `__type`) should carry elevated costs. Alternatively, consider migrating to a GraphQL library with built-in depth/complexity support (e.g., `gqlgen` with its complexity extension, or `graph-gophers/graphql-go` with its `MaxDepth` option). 3. **Implement Rate Limiting and Response Size Controls** — Add per-user rate limiting on the GraphQL endpoint. Suggested thresholds: 60 requests/minute for authenticated users, 2 requests/minute for introspection queries. Cap response payload size (e.g., 5 MB). For subscriptions, enforce maximum concurrent connections per client, idle timeouts, and maximum subscription duration. 4. **Add Resource Limit Configuration** — Extend the `GraphQL` struct in `gateway/gateway/config/config.go` to expose all resource limits (max query depth, max complexity, max response size, rate limit thresholds) as configurable parameters. This ensures all protective thresholds can be tuned per environment without code changes. ## References - [OWASP GraphQL Cheat Sheet — Resource Limits](https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html) - [OWASP API4:2023 — Unrestricted Resource Consumption](https://owasp.org/API-Security/editions/2023/en/0xa4-unrestricted-resource-consumption/) - [CWE-770: Allocation of Resources Without Limits or Throttling](https://cwe.mitre.org/data/definitions/770.html) - [CWE-400: Uncontrolled Resource Consumption](https://cwe.mitre.org/data/definitions/400.html) ## Classification - **CWE-770** — Allocation of Resources Without Limits or Throttling - **CWE-400** — Uncontrolled Resource Consumption - **OWASP Top 10 2021:** A05:2021 — Security Misconfiguration - **OWASP API Security Top 10:** API4:2023 — Unrestricted Resource Consumption - **STRIDE:** Denial of Service (D) ## Internal Reference HASI2026141-32 — Due: 2026-04-16
- Yayın
- 8 Nis 2026
- Güncelleme
- 25 Haz 2026
- EPSS
- —
- CWE
- CWE-400
Rapor araçları
Aksiyon skoru
26
Şimdilik düşük öncelik.
- CVSS
- 26 / 40 · 6.5 / 10
- CISA KEV
- 0 / 30 · Listede değil
- EPSS
- 0 / 30 · —
Bu kayıt değişirse haber alın
- KEV'de değil: sahada sömürü kaydı yok
- Herkese açık istismar kodu kaydı yok
- Düzeltme yayımlandı
Bunlardan biri değişirse günlük e-posta özetinde haber veririz.
Sürümünüz etkileniyor mu? Kontrol edinNoroxi analizi
Sizin ortamınızda ne anlama geliyor?
Yukarıdaki değerlendirme kaydın verisinden otomatik üretilir; ortamınızı bilmez. Bu açığın sizde gerçekten sömürülebilir olup olmadığını ve hangi önlemin yeteceğini ekibimiz sizin sistemlerinizde doğrular.
Bu ürünü kullanıyoruz, yardım isteyinEtkilenen sistemler
Sürümünüz etkileniyor mu?
Ürünü seçip kullandığınız sürümü yazın. Bu kaydın sürüm aralıklarıyla tarayıcınızda karşılaştırılır; sürüm hiçbir yere gönderilmez.
| Üretici | Ürün | CPE |
|---|---|---|
| Go | github.com/platform-mesh/kubernetes-graphql-gateway | pkg:golang/github.com/platform-mesh/kubernetes-graphql-gateway |
Paket düzeyi etkilenme
OSV ve GitHub Advisory verisi: ekosistem, paket ve aralık. SBOM eşleşmesi bu tabloyu kullanır.
| Ekosistem | Paket | Etkilenen aralık | Düzeltme |
|---|---|---|---|
| Go | github.com/platform-mesh/kubernetes-graphql-gateway | 1.2.9 öncesi | 1.2.9 |
Aynı üründe
Go: tüm kayıtlarAynı birincil ürünün en yüksek skorlu diğer kayıtları.
- GO-2026-5420kubernetes-graphql-gateway: GraphQL Endpoint Vulnerable to Authenticated Denial-of-Service via Unrestricted Query Execution in…0İzleyin
Düzeltme
Hangi sürüme geçmeli
Üretici, paket deposu ve Microsoft kayıtlarından derlenen düzeltme sürümleri. Yükseltmeden önce üreticinin notunu doğrulayın.
| Ürün / paket | Düzeltilmiş sürüm | Kaynak |
|---|---|---|
| Go:github.com/platform-mesh/kubernetes-graphql-gateway | 1.2.9 | Paket deposu (OSV) |
İstismar durumu
Bilinen kamuya açık istismar yok
Şu an kamuya açık bir istismar görülmedi. Bu, güvende olduğunuz anlamına gelmez; yalnızca eşiğin biraz daha yüksek olduğunu gösterir.
Araştırma bağlamı
Pentester ve araştırmacı için: saldırı profili, puan anlaşmazlığı, zaman çizelgesi, yama commit’leri, kredi, varyant ve zincir adayları, bug bounty kapsamı. Hepsi mevcut veriden türetilir; istismar kodu içermez.
Zaman çizelgesi
Yayından bugüne: kavram kanıtı, Metasploit modülü, CISA KEV ve düzeltme kaydı. Tarihler kaynakların bildirdiği tarihlerdir.
Yayın dışında tarihli olay yok.
Yama ve commit bağlantıları
Referanslardaki commit, PR ve diff adresleri. Patch-diff ve varyant avı için başlangıç noktası; istismar değil, düzeltmedir.
Bu kayıtta yok: EPSS geçmişi · araştırmacı kredisi · varyant ya da zincir adayı · herkese açık ödül programı.
Teknik detay
Saldırı koşulları
- İnternetten erişebilen herkes tetikleyebilir.
- Düşük yetkili bir hesap yeterli.
- Kullanıcının bir şey yapması gerekmez.
- Özel bir koşul gerekmez; tekrarlanabilir.
Başarılı olursa
- Gizlilik
- yok
- Bütünlük
- yok
- Erişilebilirlik
- yüksek · hizmet durdurulabilir
- Saldırı vektörü
- Ağ
- Karmaşıklık
- Düşük
- Gereken yetki
- Düşük
- Kullanıcı etkileşimi
- Gerekmez
- Kapsam
- Değişmez
- Gizlilik etkisi
- Yok
- Bütünlük etkisi
- Yok
- Erişilebilirlik etkisi
- Yüksek
Zayıflık sınıfı (CWE)
CWE-400 · Uncontrolled Resource ConsumptionCVSS vektörü
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
osv
Kök neden
İç içe yapıları çözümleyen kod derinlik ya da boyut sınırı koymuyor. Küçük bir girdi orantısız işlem yüküne dönüşebilir.
Hatanın kod karşılığı
CWE-400 sınıfının tamamıBu zafiyet sınıfının temsili örneği. Üreticinin kaynak kodu değildir; hatalı kalıbı ve düzeltmesini gösterir.
Hatalı
function expand(node) {
return node.children.map(expand);
}Düzeltilmiş
const MAX_DEPTH = 32;
function expand(node, depth = 0) {
if (depth > MAX_DEPTH) throw new Error("çok derin");
return node.children.map((c) => expand(c, depth + 1));
}Saldırı bağlamı
Bu zafiyet sınıfının (CWE) MITRE CAPEC saldırı desenleri ve ATT&CK teknikleri. Tespit kuralı ve tehdit avı için başlangıç noktası.
Saldırı desenleri (CAPEC)
ATT&CK teknikleri
Değişiklik günlüğü (1)
- Düzeltme✗ → ✓
Takip ettiğiniz kayıtlarda bu değişiklikler bildirim olarak da gelir. →
Referanslar
Tüm referansları göster (3 daha)Daha az göster
Üretici bildirimleri ve resmî kayıtlar. İstismar/PoC bağlantıları bilinçli olarak dışarıda bırakıldı.