Cocos AI Intra-handshake attested TLS implementation is vulnerable to TOCTOU AttacksGHSA-ghwv-vrp2-2975
MEDIUMFix: ultravioletrs/cocos#582GHSA-ghwv-vrp2-2975 is a medium-severity (CVSS 6.3) CWE-367 vulnerability in github.com/ultravioletrs/cocos. A fix is available for github.com/ultravioletrs/cocos — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-ghwv-vrp2-2975.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
github.com/ultravioletrs/cocosReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
An attacker who can modify the attested workload’s code, memory-backed state, or configuration after the initial attestation — but without necessarily terminating the existing TLS connection — can cause the peer to continue trusting the connection as if the originally attested state were still running.
Details
Once attestation is successfully appraised and connection is established, there is a window of vulnerability from the establishment of connection to the termination of connection where an attacker can modify the state of the workload and platform at runtime on the TLS endpoint acting as the Attester. Workload state includes code, data, and configuration. Other examples of state changes at the workload level include cases where a new device (such as a GPU) is connected, or where a connected device is disconnected, since the connection establishment.
In Cocos AI, there is no mechanism for the peer to know that some state has changed in the Attester after the connection establishment. The vulnerability is particularly concerning for long-lived connections.
In short, this vulnerability was possible because Cocos AI performs attestation only once in the lifetime of the connection (at connection establishment time) and the verifying peer continues to believe that the state is the same as in initial Evidence throughout, whereas it could be stale at some point in time.
This vulnerability for Cocos AI was found and demonstrated by Muhammad Usama Sardar via formal analysis. Formal analysis was performed in the state-of-the-art tool, ProVerif.
Workarounds
The proposed workaround is to allow re-attestation of the workload after periodic or user-defined intervals using post-handshake attestation.
Background and General Technical Details
For background and general (not specific to Cocos AI) technical details on this vulnerability, please see G-RA2: Freshness of Evidence in Sec. 5.1.1 of Identity Crisis in Confidential Computing: Formal Analysis of Attested TLS. Also, see the corresponding formal analysis.
Credits
This vulnerability for Cocos AI was found and responsibly disclosed by Muhammad Usama Sardar (TU Dresden, Germany).
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/ultravioletrs/cocos | all versions | 0.9.0go get github.com/ultravioletrs/cocos@v0.9.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/ultravioletrs/cocos, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/ultravioletrs/cocos to 0.9.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-ghwv-vrp2-2975 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-ghwv-vrp2-2975 in your dependencies?
Find it across Go, including transitive dependencies.