CVE-2026-44300 in OpenCostinfo

Summary

by MITRE • 09/15/2026

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.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 09/15/2026

The vulnerability identified in OpenCost versions prior to 1.121.0 represents a critical authentication bypass and insecure direct object reference flaw within the application's cost monitoring infrastructure for Kubernetes workloads and cloud environments. The core of this issue resides in the POST /serviceKey endpoint located in the pkg/costmodel/router.go module, which fails to enforce mandatory authentication mechanisms before processing requests. This lack of access control allows any network client with connectivity to the service to invoke the AddServiceKey function without providing valid credentials or session tokens. In a typical enterprise Kubernetes environment where OpenCost is deployed for monitoring cloud expenditures across multiple projects and subscriptions, this absence of authorization checks creates a significant attack surface that can be exploited by both external attackers on public networks and malicious insiders with access to internal network segments.

The technical exploitation involves submitting an arbitrary key form value through the unauthenticated endpoint, which results in the direct overwriting of the GCP service-account key.json file. This file is retrieved via the GetGCPAuthSecretFilePath function defined in core/pkg/env/core.go and serves as a critical credential store for authenticating with Google Cloud Platform services to gather cost data. While the attacker does not have control over the CONFIG_PATH-derived directory, the specific filename of key.json, or the underlying file permissions, they retain full authority over the contents written into this JSON structure. By injecting maliciously crafted credentials, an adversary can effectively hijack the identity used by OpenCost when interacting with GCP APIs. This capability transforms a monitoring tool intended for cost visibility into a vector for privilege escalation and data exfiltration within the cloud environment.

The operational impact of this vulnerability is severe due to its direct influence on financial operations and security posture. If an attacker replaces the legitimate service account credentials, OpenCost will subsequently authenticate using the attacker-controlled keys. This allows the adversary to manipulate cost reports by injecting false usage metrics or hiding actual resource consumption, thereby obscuring unauthorized activities such as cryptomining or data exfiltration from organizational oversight. Furthermore, the disruption of GCP cost collection can lead to inaccurate billing and budgeting decisions for the organization. The presence of a wildcard Access-Control-Allow-Origin response header further exacerbates the risk by permitting cross-origin requests from web browsers. This configuration enables browser-assisted attacks where a victim user, potentially authenticated in another context or simply visiting a malicious site, could trigger state-changing actions against the OpenCost API if it is accessible via a standard web interface, facilitating potential CSRF-style exploitation vectors even without traditional session cookies depending on specific deployment configurations.

From a classification perspective, this vulnerability aligns with CWE-287 Improper Authentication and CWE-915 Improperly Controlled Modification of Dynamically-Determined Object Attributes. The ability to overwrite configuration files through user-controlled input is also indicative of CWE-436 Interpretation Conflict if the application fails to validate that the incoming JSON structure matches expected schemas before writing, although the primary failure here is the lack of authentication rather than validation logic per se. In terms of adversary tactics, this flaw supports ATT&CK technique T1078 Valid Accounts and potentially T1529 System Network Configuration Discovery if used in conjunction with other tools to map out cloud resources using the stolen credentials. The wildcard CORS policy also relates to security misconfigurations often associated with cross-origin resource sharing abuses found in modern web application architectures.

Mitigation strategies must prioritize immediate patching of OpenCost to version 1.121.0 or later, where these authentication checks have been implemented. In environments where upgrading is not immediately feasible, network-level controls should be enforced to restrict access to the /serviceKey endpoint exclusively to trusted internal IP ranges using firewall rules or service mesh policies. Additionally, implementing strict CORS policies that limit Access-Control-Allow-Origin to specific, known origins rather than wildcards will reduce the risk of browser-based exploitation vectors. It is also recommended to audit existing GCP service account permissions and rotate any keys that may have been exposed during periods when the vulnerability was present in production environments. Regular security assessments focusing on API authentication flows and configuration file integrity checks should be integrated into the development lifecycle to prevent similar insecure direct object references from recurring in future updates of cloud-native monitoring tools.

Responsible

GitHub M

Reservation

05/05/2026

Disclosure

09/15/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!