Description
OpenCost provides cost monitoring for Kubernetes workloads and cloud costs. Prior to 1.121.0, the POST /serviceKey endpoint in pkg/costmodel/router.go allows a network client to invoke AddServiceKey without mandatory authentication and submit an arbitrary key form value that is written to the GCP service-account key.json file returned by GetGCPAuthSecretFilePath in core/pkg/env/core.go. The attacker controls the file contents but not the CONFIG_PATH-derived directory, the key.json filename, or the file mode. Replacing the credential contents can disrupt GCP cost collection or cause OpenCost to use attacker-selected credentials, and the wildcard Access-Control-Allow-Origin response permits browser-assisted requests when the service is reachable from a browser. This issue is fixed in version 1.121.0.
Published: 2026-09-15
Score: 8.8 High
EPSS: n/a
KEV: No
Impact: Unauthorized Credential Overwrite
Action: Immediate Patch
AI Analysis

Impact

The OpenCost service exposes a POST /serviceKey endpoint that allows unauthenticated clients to submit arbitrary key data. This data is written to the GCP service‑account key.json file used by the application. An attacker can replace the real credentials with attacker‑controlled ones, causing OpenCost to operate under compromised credentials and potentially allowing the attacker to read or modify GCP resources and disrupt cost monitoring. The vulnerability also leaks the service using an Access‑Control‑Allow‑Origin set to a wildcard, which permits browser‑based exploitation when the endpoint is reachable from a browser.

Affected Systems

OpenCost versions earlier than 1.121.0 are affected. The issue exists in the pkg/costmodel/router.go router handling the /serviceKey POST endpoint. Only deployments using the OpenCost cost monitoring component in Kubernetes clusters are impacted. Up to version 1.120.0 vulnerabilities remain; 1.121.0 and newer contain the fix.

Risk and Exploitability

This flaw carries a CVSS score of 8.8, indicating high severity. EPSS is not available, so the current probability of exploitation is unknown. The vulnerability is not listed in CISA's KEV catalog at this time. Attackers can exploit the unauthenticated endpoint over a network or through a web browser if the service is exposed, and can inject arbitrary service‑account keys. Successful exploitation would allow the attacker to assume the identity of a Google Cloud service‑account, potentially leading to data exfiltration or denial of service to other workloads.

Generated by OpenCVE AI on September 15, 2026 at 23:08 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade OpenCost to version 1.121.0 or newer, which removes the unauthenticated endpoint and hardens credential handling.
  • If an upgrade is not immediately feasible, restrict network access to the /serviceKey endpoint (e.g., firewall rules or Kubernetes NetworkPolicy) so that only authorized internal workloads can reach it.
  • Monitor the GCP service‑account key.json file for unexpected changes and enforce file integrity checks or audit logging on modifications.

Generated by OpenCVE AI on September 15, 2026 at 23:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-wmj8-9953-vff5 OpenCost ServiceKey Endpoint Unauthorized Credential Overwrite/Injection
History

Tue, 15 Sep 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 15 Sep 2026 19:45:00 +0000

Type Values Removed Values Added
First Time appeared Opencost
Opencost opencost
Vendors & Products Opencost
Opencost opencost

Tue, 15 Sep 2026 17:30:00 +0000

Type Values Removed Values Added
Description OpenCost provides cost monitoring for Kubernetes workloads and cloud costs. Prior to 1.121.0, the POST /serviceKey endpoint in pkg/costmodel/router.go allows a network client to invoke AddServiceKey without mandatory authentication and submit an arbitrary key form value that is written to the GCP service-account key.json file returned by GetGCPAuthSecretFilePath in core/pkg/env/core.go. The attacker controls the file contents but not the CONFIG_PATH-derived directory, the key.json filename, or the file mode. Replacing the credential contents can disrupt GCP cost collection or cause OpenCost to use attacker-selected credentials, and the wildcard Access-Control-Allow-Origin response permits browser-assisted requests when the service is reachable from a browser. This issue is fixed in version 1.121.0.
Title OpenCost ServiceKey Endpoint Unauthorized Credential Overwrite/Injection
Weaknesses CWE-20
CWE-309
References
Metrics cvssV4_0

{'score': 8.8, 'vector': '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'}


Subscriptions

Opencost Opencost
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-09-15T19:45:01.536Z

Reserved: 2026-05-05T17:39:31.113Z

Link: CVE-2026-44300

cve-icon Vulnrichment

Updated: 2026-09-15T19:16:36.678Z

cve-icon NVD

Status : Received

Published: 2026-09-15T18:17:21.280

Modified: 2026-09-15T20:17:15.993

Link: CVE-2026-44300

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-15T23:15:15Z

Weaknesses
  • CWE-20

    Improper Input Validation

  • CWE-309

    Use of Password System for Primary Authentication