Summary
CVE-2026-44300 is an unauthenticated file-write vulnerability in OpenCost’s POST /serviceKey HTTP endpoint. The endpoint accepts attacker-supplied data and writes it directly to the GCP service-account credential file used for cost collection, with no authentication or input validation. The issue is rated HIGH severity (CVSS 8.8) and affects all OpenCost deployments running a version prior to 1.121.0 that expose the API to the network.
Technical details
- Root cause: the
AddServiceKeyhandler inpkg/costmodel/router.goaccepts akeyform value onPOST /serviceKeyand writes it verbatim to the GCP service-accountkey.jsonfile (path returned byGetGCPAuthSecretFilePath) without requiring authentication or validating the submitted content. - Trigger conditions: any network client that can reach the OpenCost API endpoint can send a crafted POST request; no credentials or prior access are required.
- Attack vector: Network (remote, unauthenticated). The advisory also notes the endpoint returns a permissive
Access-Control-Allow-Origin(CORS) header, which can allow a victim’s browser to be used to relay the malicious request. - Impact: the attacker controls the contents written to the GCP credential file (though not its directory, filename, or file mode), which can disrupt GCP cost-collection functionality or cause OpenCost to operate using attacker-supplied/attacker-controlled credential data, potentially leading to service disruption and downstream credential-related compromise in the Kubernetes environment where OpenCost runs.
Affected software
- OpenCost: all versions prior to 1.121.0
- Fixed in: OpenCost 1.121.0
Severity
- CVSS v4.0 Base Score: 8.8 (High)
- CVSS v4.0 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
Mitigation and recommended actions
- Immediate: Upgrade OpenCost to version 1.121.0 or later, which addresses the missing authentication and input validation on the
/serviceKeyendpoint. - If immediate patching is not possible:
- Restrict network access to the OpenCost API/UI (e.g., via network policies, firewall rules, or by not exposing it directly to untrusted networks) so that only trusted internal callers can reach it.
- Ensure any reverse proxy or ingress in front of OpenCost enforces authentication and does not forward permissive CORS behavior to end users.
- Monitor and rotate the GCP service-account credential file used by OpenCost if exposure is suspected.

