OpenCost ServiceKey Endpoint Unauthorized Credential Overwrite/Injection
21Vexday Risk Score
No sign of exploitation. No public exploitation artifact known so far.
ssvc Trackcvss 8.8epss 0.4%
exploitation probability
0.4%top 65% of all CVEs
observed exploitation
nono source reports it
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.
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
Affected products
opencost · opencostReferences
https://github.com/opencost/opencost/commit/69430e7f627b3e62c8999312c06949267fab813ahttps://github.com/opencost/opencost/commit/a49a25bc2e0d6e220a131a4dc58f38ebe6ae851bhttps://github.com/opencost/opencost/pull/3651https://github.com/opencost/opencost/pull/3910https://github.com/opencost/opencost/releases/tag/v1.120.0https://github.com/opencost/opencost/releases/tag/v1.121.0https://github.com/opencost/opencost/security/advisories/GHSA-wmj8-9953-vff5