Cordyceps: The CI / CD threat that breaks the border of trust and can take control of repositories and steal credentials

Author: Published 4 min de lectura 146 reading

The images in this article were generated with artificial intelligence. How we publish

Cordyceps, the name Novee Security gave to an exploitable pattern in CI / CD pipelines, is an urgent warning for open source projects and large organizations: apparently valid configurations can allow an anonymous attacker take control of repositories, run code in CI runners and steal credentials, with consequences across the entire software supply chain.

The root of the problem is not a linear bug but a composition failure: workflows that, by how they are chained or by what permits they grant, allow unreliable data to cross a border of trust. So, a comment, the name of a malicious branch or pull request (PR) can become a vector to run privileged commands in infrastructure of organizations like Microsoft, Google, Apache or Cloudflare, according to Novee's report. That feature - that a free and anonymous account can start the attack - dramatically increases the risk.

Cordyceps: The CI / CD threat that breaks the border of trust and can take control of repositories and steal credentials
Image generated with IA.

The danger is double. On the one hand are the immediate effects: remote running in runners, tokens exfiltration or keys integrated into automation systems and ability to merge or publish malicious code. On the other hand, there is the systemic effect: compromising a dependency or a popular bookstore can spread malicious code to countless projects and customers, generating multiple damage that remembers why supply chain security is now a strategic priority.

That this kind of problem escapes classic analysis tools should not be surprising. Scanners usually check that each individual piece does "what is supposed," but not always modeling the emerging security that appears when different flows interact, event triggers cross permissions and secrets contexts are inadvertently accessible under specific conditions.

For maintenance and safety equipment the practical recommendations are clear and applicable right now: to minimize permissions given by default to tokens and workflows; to avoid exposing secrets in contexts where unverified contributions can activate them; to prefer the principle of lower privilege in workflows and to explicitly set the section permissions in GitHub Actions or equivalents in other CI; require branch reviews and protections before allowing automatic mergers; and rotate or remove keys not expiring or pipelines.

There are also complementary technical mitigations that should be adopted: running validations in isolated runners without access to secrets, prohibiting workflows from forks from using repository secrets, using ephemeral identities (e.g. OIDC) rather than long-life tokens, and auditioning the trigger chains to detect points where an unreliable event can induce execution with privileges. It is also relevant to incorporate static analysis and specific rules to detect "trust boundary crossing" patterns in CI YAML.

Large organizations must assume that the attack surface includes inherited configurations and popular projects maintained by open communities. In addition to applying hardening, it is recommended to establish detection and response: alerts to changes in workflows, activity monitoring in runners, and audit of tokens and automatic approvals. For those who maintain critical packages or infrastructure, adhere to frameworks such as SLSA and public security guides of CI actions helps to institutionalize good practices: https: / / slsa.dev / and GitHub's official guide for hardening of Actions are concrete starting points: https: / / docs.github.com / en / actions / security-guides / security-hardening-for-github-actions.

Cordyceps: The CI / CD threat that breaks the border of trust and can take control of repositories and steal credentials
Image generated with IA.

The Cordyceps case also recalls the importance of responsible disclosure: the reported findings have led to confirmations and mitigations by affected suppliers, but the lesson lasts. The CI / CD security is not just to set up every piece well, but to understand and audit how those pieces interact. when external contributions are received.

If you manage repositories or CI platforms, now prioritize a review of your workflows and the permits associated with tokens, automate the detection of dangerous patterns in your YAML and review any use of persistent credentials in automation systems. For risk and governance equipment, make it a contractual requirement for critical projects: CI / CD hardening tests and credentials rotation evidence before allowing automatic integrations.

The threat is real, exploitable in the open world and able to scale quickly; the response must be quick and structured: to reduce the attack surface, to tighten the borders of trust and to continuously audit the composition of our pipelines so that the software we deliver does not bring hidden surprises.

Coverage

Related

More news on the same subject.