request-cache-pyPyPI
Malicious code in request-cache-py (PyPI) Remove it immediately and rotate any exposed credentials.
What this malware does
request-cache-py impersonates the legitimate requests-cache HTTP caching library. On import request_cache_py, the package's __init__.py starts a background thread that harvests installer-side secrets and POSTs them to a hardcoded attacker Telegram bot.
Observed behaviors:
- Reads private keys and credentials from
~/.ssh/(id_rsa,id_ed25519,id_ecdsa,id_dsa),~/.aws/credentials,~/.aws/config,~/.gitconfig,~/.git-credentials,~/.npmrc,~/.pypirc,~/.dockercfg,~/.docker/config.json, plus gcloud and vscode settings. - Copies Chrome/Edge/Safari
Login Data,Cookies, andHistorySQLite databases to/tmpand extracts saved logins, cookies, and browsing history (SELECT origin_url, username_value FROM logins;SELECT host_key, name, value, path FROM cookies). - Iterates
os.environand exfiltrates any variable whose name containskey,token,secret,password,api, orauth. - Posts the collected data to
https://api.telegram.org/bot<redacted>/sendMessagewith a fixedchat_id. The bot token and chat id are base64-split across pieces and reassembled at runtime to evade scanners. - Includes sandbox-evasion:
_should_skip()aborts whenCI,GITHUB_ACTIONS,TRAVIS,JENKINS_HOME,CIRCLECI,/.dockerenv, or hypervisor markers are present, restricting execution to real developer workstations. A~/.cache/.pyrcmarker suppresses repeat sends within 24 hours.
The combination — name impersonation of a popular library, import-time credential harvest from classic developer secret paths, browser database theft, env scraping, base64-obfuscated C2, sandbox evasion — is a deliberate supply-chain credential stealer targeting human developers.
During import, package exfiltrates browsers data, SSH keys and other credential files, env variables and other sensitive data.
Category: MALICIOUS - The campaign has clearly malicious intent, like infostealers.
Campaign: 2026-06-request-cache-py
Reasons (based on the campaign):
-
infostealer
-
exfiltration-env-variables
-
exfiltration-ssh-keys
-
impersonation
-
A Telegram webhook is used to send collected data.
-
exfiltration-browser-data
-
The package contains code to detect if it is running in a sandbox environment.
-
exfiltration-credentials
-
The malicious code is intentionally included in a dependency of the package
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Credential / info stealerFind it
Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for request-cache-py (11 malicious versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging request-cache-py across your stack and pipelines.
If you installed it — respond
request-cache-py is built to steal secrets, so assume every credential the build or runtime could read is compromised. Remove it from your project and lockfile, then rotate ALL exposed secrets — npm/registry tokens, cloud keys, CI/CD secrets, SSH keys, and any .env values — from a known-clean machine. Audit logs for unauthorized use of those credentials.
Did it already run?
If request-cache-py was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.
How O3 protects you
O3 blocks request-cache-py before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
- Kamil Mańkowski (kam193) · reporter
Detect & block this
O3 blocks request-cache-py-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the credential exfiltration and severs the channel.