Secrets and API key exposure in 2026: Copilot CLI, Railway and RubyGems.org
How a Copilot CLI flaw, the Railway breach and a RubyGems.org cache bug put developer credentials at risk, and what each vendor says it changed.
- Published
- Sources
- 4
By the cisonews.ai Desk · Published · Updated
Three cases, three mechanisms
Three primary sources from 2026 describe developer credentials put at risk in different ways. GitHub's advisory of March 6, 2026 covers an AI coding agent whose command safety check could be bypassed. Railway's reports of October 22 and November 10, 2026 describe an intrusion that, according to the company's forensic investigation, was aimed at AI provider credentials stored on its hosting platform. RubyGems.org's advisory of July 22, 2026 describes a CDN cache that handed one account's API key to another.
The sections below cover each case in turn: what was exposed, how it happened, and what the vendor says it changed.
GitHub Copilot CLI: hidden commands that passed as read-only
GitHub's advisory for CVE-2026-29783, rated High with a CVSS score of 7.5, says a flaw in the shell tool of the Copilot CLI, distributed as the npm package @github/copilot, could let crafted bash parameter expansion patterns run arbitrary code in versions before 0.0.423.
The advisory explains how the bypass worked. The CLI's safety layer sorts commands into two groups: read-only commands that run freely, and write-capable commands that need user approval. Operators such as ${var@P}, ${var=value}, ${!var} and nested $(cmd) could hide executable code inside the arguments of a harmless-looking command like echo. Before the fix, the safety assessment classed such a command as read-only and ran it without asking the user, even in modes that require approval for writes.
The advisory lists three ways an attacker could inject such commands: prompt injection through repository content such as README files, code comments and issue bodies; compromised or malicious MCP server responses; and crafted user instructions with obfuscated commands. It states that successful exploitation could lead to data exfiltration, file modification or further compromise of the user's workstation.
On the fix, the advisory describes three layers of defense:
- Parse-time detection, which downgrades commands containing these patterns to write-capable.
- Unconditional blocking at the tool execution layer, regardless of permission mode, including --yolo and autopilot.
- System prompt hardening, which instructs the model to refuse such commands.
It also tells users to upgrade to 0.0.423 or later, to take care with untrusted repositories and MCP servers, and to review agent-suggested commands that contain complex parameter expansion.
Railway: an intrusion that hunted for AI provider keys
Railway's November 10 incident report says the attack began at 07:28 UTC on October 20, 2026. The attacker exploited an unknown flaw to partially escape filesystem isolation in the multi-tenant build system and took a build server credential. Railway's internal Temporal instance accepted that credential as a trusted client, which let the attacker read the stored histories of other builds, including environment variables and secrets passed to them.
According to the report, the attacker then obtained a copy of Railway's internal monorepo and scanned it. At 03:26 UTC on October 21, the attacker used a misconfigured identity binding to obtain short-lived cloud credentials. From there the attacker retrieved an SSH key and a longer-lived decryption credential and reached the database holding envelope-encrypted customer variables.
The report states that the attacker's database queries matched variable names against regular expressions to prioritise AI provider keys and targeted customers with large numbers of variables. An additional query also matched cloud, database and payment service credentials.
Railway puts the exposure at three levels:
- At most 1.85% of workspaces, about 100,000, could have had environment variables decrypted. The report calls this an upper bound, because the logs identify environments rather than individual variables.
- The stored histories of 353 builds were read.
- The decrypted data included linked-account tokens, meaning BYOK agent keys and GitHub OAuth tokens, for 1,852 users.
The report estimates unauthorized spend on the stolen keys at about $740,000. Railway says it believes the credentials were passed to distributed transfer stations for use in distillation, and it notes that OpenCode, Warp, Fireworks AI and others disclosed similar thefts between October 6 and 23.
What Railway says it changed
During the incident, Railway says it took four main steps:
- It halted builds twice.
- It rotated internal credentials.
- It invalidated every user session and token at 20:19 UTC on October 21.
- From 09:25 UTC that day, it asked GitHub, GitLab, Anthropic, OpenAI, OpenRouter, SpaceXSI, Google and Stripe to revoke potentially compromised keys, supplying hashes of every key it held.
The October 22 preliminary report asked every customer who signed up before October 21 to rotate keys stored on Railway. It also explained that a revocation email from a vendor does not by itself mean a customer was affected, because some vendors received every API key on the platform.
For the build and deployment pipeline, the November report lists three changes:
- Each build now runs on a dedicated ephemeral virtual machine, with a credential that can only push a specific OCI image.
- The CI systems have been rebuilt and now require 2FA approval and biometrics in critical areas.
- Every service account has been reviewed, with short-lived, narrowly scoped credentials used wherever possible.
For secrets, the report says every encrypt and decrypt operation is now centrally audit logged. Only the secrets service can reach the keys that decrypt data encryption keys, and each calling service can decrypt only the credentials it needs. On fraudulent token spend, the report says Railway will cover losses where providers decline to refund them, naming Anthropic in the interim and OpenRouter.
RubyGems.org: a cache that served one account's key to the next caller
RubyGems.org's advisory says a CDN caching bug could give one account's API key to another person for up to an hour. Affected users were those who signed in with a gem client older than v3.2.0, which calls GET /api/v1/api_key. The advisory adds that 18% of gem signin sign-ins still come from such versions, and that the client bundled with macOS Tahoe is version 3.0.3.1.
The advisory describes the failure as a chain:
- The Ruby client sends Accept-Encoding: gzip by default.
- Rack::Deflater compressed the response body, so Rack::ETag fell back to a bare no-cache header with no Vary: Authorization.
- Fastly then cached the successful response, which contained the key, under a shared cache key at that edge node.
Because those cache hits were served without contacting the origin server, an unauthenticated party could also query the endpoint and collect whatever key was cached.
The advisory says a legacy key carried every gem-management permission across every gem the account owned and never expired. The application-side trigger was introduced on October 10, 2016, so the conservative assumption is that the endpoint was exploitable for most of the roughly nine years since. The maintainers found no sign of malicious use, but they note that their logs cover only a recent window.
What RubyGems.org says it changed
The bug was reported on July 6, 2026 by Luke Marshall of Truffle Security. A fix in commit d3d11c0, deployed on July 9, 2026, sets these headers on the key response and other authenticated endpoints:
- Cache-Control: private, no-store
- Surrogate-Control: max-age=0
- Vary: Authorization
The affected Fastly objects were purged before any keys were revoked.
RubyGems.org then revoked every legacy API key, leaving scoped keys and short-lived OIDC trusted-publisher keys untouched, and retired the old sign-in endpoint. Because an added owner or a registered trusted publisher survives key revocation, the advisory asks owners to check each gem for:
- versions they did not publish,
- unexpected yanks,
- unfamiliar owners,
- trusted publishers they did not configure,
- unrecognised webhooks.
Going forward, the maintainers recommend scoped keys over full-access keys, MFA enabled for API access, and trusted publishing in place of long-lived keys in CI. They also say they are looking at expanding the two-factor authentication requirement across the platform in 2026.
Sources (4)
- [1]GitHubgithub.comMarch 6, 2026tier A · Primary
- [2]Railwayblog.railway.comNovember 10, 2026tier A · Primary
- [3]Railwayblog.railway.comOctober 22, 2026tier A · Primary
- [4]RubyGems.orgblog.rubygems.orgJuly 22, 2026tier A · Primary
Tuesdays, by email
Pages like this one, every Tuesday
One email with the week’s new incidents, explainers and rules, sorted by topic.
Unsubscribe any time.