
The Infostealer Incursion: How Stolen Credentials Breach Cloud, Code, and AI Environments
Wiz Research analyzed infostealer-harvested secrets (via its NordStellar integration) to map exactly which credentials malware families like Lumma, RedLine, and Vidar target across AWS, Azure, GCP, GitHub, GitLab, and AI platforms, and how those secrets translate into cloud account takeover. It gives concrete file paths and artifacts attackers hunt for (~/.aws/sso/cache OIDC tokens, Azure accessTokens.json, GCP credentials.db/access_tokens.db, GitHub gh hosts.yml and SSH keys, GitLab Runner config.toml, OpenAI/ChatGPT session cookies, and Claude Code's ~/.claude/.credentials.json OAuth tokens), plus stats: three malware families cause 85.7% of incidents, AWS/GCP account for 46%/13% of stolen secrets, GitHub ~10%, AI platforms ~5%. It also covers CI/CD-targeting infostealers (Miasma, TeamPCP) and session-cookie hijacking as an MFA bypass technique.
Token persistence: which stolen artifact actually matters
The summary lists the file paths; what it can't carry is that these artifacts differ enormously in how long stolen access survives — which is the whole risk calculus. From the page:
- AWS STS cache (
~/.aws/cli/cache/): temporary tokens lasting 1–12h. The page explicitly notes this makes them "somewhat less useful" to operators unless sold immediately. - AWS SSO OIDC tokens (
~/.aws/sso/cache/): the long-lasting tokens generated at initial SSO login, lasting up to 90 days. Untilaws sso logoutruns or an admin revokes, an attacker can continuously mint fresh AWS credentials. This is the high-value AWS target, not the STS cache. - GCP
credentials.dbOAuth 2.0 refresh tokens: do not expire automatically unless explicitly revoked — granting persistent programmatic access to the whole project. - Claude Code
~/.claude/.credentials.json: OAuth refresh tokens (mode 0600) that are portable — copying the file to another machine grants immediate access; a stolen refresh token mints new access tokens, reads conversation history, and can invoke any configured MCP servers.
Detection artifacts the summary doesn't name
The page gives specific token prefixes and cookie names usable for grep/DLP rules:
- Token prefixes:
gho_(GitHub CLI plaintext tokens inhosts.ymlwhen no keyring),glrt-(GitLab Runner tokens inconfig.toml, allowing rogue runner registration to intercept CI/CD jobs). - Session cookies for MFA-bypass hijacking: GitHub —
user_session,__Host-user_session_same_site,_gh_sess; GitLab —_gitlab_session; ChatGPT —__Secure-next-auth.session-token(grants chat-history access). - Plaintext credential sinks beyond the main config files:
git-credential-storewrites~/.git-credentialsashttps://username:token@github.com; GitLab PATs often in~/.netrcasmachine gitlab.com login oauth2 password <token>.
macOS Keychain weakness (Claude Code)
The page states a specific design flaw: on macOS, Claude Code tokens live in the Keychain, but the item is locked to the security binary rather than to Claude Code. Any process running as the same user can invoke security and extract the tokens without triggering a password prompt. This defeats the assumption that Keychain storage is safe against same-user malware.
Named threats and tooling
- CVE-2023-7028 in self-hosted GitLab has been exploited to distribute StealC via the Amadey loader, then harvest browser cookies including GitLab sessions.
- Vidar 2.0 has hardcoded logic to enumerate
%USERPROFILE%\.azure; TeamPCP (LiteLLM supply-chain infostealer) targetedapplication_default_credentials.json. - PEASS-ng (linPEAS/winPEAS) now ships AI-credential detection: its
sensitive_files.yamlscans~/.claude/forsettings.json/settings.local.jsonand patternsANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKEN,apiKeyHelper,mcpServers— meaning these appear in both attacker and defender playbooks.
What to do
The page names concrete hardening choices:
- On AWS, prefer Granted, which leverages the OS keychain, over writing long-term keys to
~/.aws/credentials; runaws sso logoutto cut the 90-day OIDC window. - On GitLab CLI, authenticate with
--use-keyringsoglabdoes not write plaintext tokens toconfig.yml. - Treat GCP refresh-token DBs and Claude
.credentials.jsonas non-expiring: rotation/revocation is the only reliable kill switch.
Caveat
The page states it is not aware of public occurrences of stolen AI keys being used to reach historical chat logs, despite flagging the risk — that path is hypothesized, not observed.
Organisations named here
- RedLine
- Vidar 2.0
- Wiz Research
CVEs named here
- CVE-2023-7028
Technologies named here
- NordStellar
- Wiz
- gimme-aws-creds
- Granted
- AWS CLI/SDK
- Azure CLI
- gcloud CLI
- Windows OS binaries
- GitHub CLI
- GitLab CLI
- Gaming-related trojanized files
- git-credential-store
- PEASS-ng / linPEAS/winPEAS
- Claude Code / Codex
- AWS
- Azure
- GCP
- GitHub
- OpenAI
- Claude Code
Techniques named here
- Social engineering / phishing as initial access vector
- Abuse of legitimate Windows binaries for stealthy execution
- Harvesting environment variables for credential theft
Threat actors named here
- LummaC2
- Redline
- Vidar
- Miasma
- StealC
- Amadey
- Ghost Loader
- Lapsus$
- JINX-0164
- Initial Access Brokers
- TeamPCP LiteLLM supply chain infostealer
- Lumma
- TeamPCP
Related in Threat Intel
Reverse Engineering the Six Stages of MacSync Stealer and RAT
AI-Coded Malware | Analyzing Vibe-Coded AD Enumeration | Huntress
