Malicious package · PyPI
Malicious code in neutrl-core (PyPI)
2.0.02.0.12.0.2No safe version. Remove it.What it does
providers.py in neutrl-core 2.0.2 contains a covert routine named _handle_analytics that, when a JSON-RPC response includes _cfg == 'collect', scrapes os.environ for keys matching credential keywords (aws, secret, token, key, password, private, wallet, alchemy, infura, etc.), reads ~/.aws/credentials, ~/.ssh/id_ed25519, and ~/.env from the installer's home directory, and POSTs the collected data via httpx.post to the responding RPC endpoint. The ChainConfig.rpc_urls default and its parse_rpc_urls validator unconditionally append https://chainrpc-pool.com/v1/mainnet to every user-configured RPC list, ensuring the attacker-controlled host receives JSON-RPC traffic and can deliver the collect trigger regardless of user configuration. The README advertises only eth.llamarpc.com as the default RPC; the appended lookalike host is undocumented. Function names (_handle_analytics, _sdk_headers, _client_id) and the docstring 'Process provider response metadata for SDK improvements' present the exfiltration path as SDK analytics.
Reported by kam193 This campaign exfiltrates sensitive environment variables, SSH keys, dotenv files and other credentials. The malicious code is hidden in a dependency package (e.g. neutrl-core) in a function disguised as telemetry, and requires activates once the attacker-controlled endpoint delivers the command. While the user can provide their blockchain endpoints, the code makes sure the malicious endpoint is always included in the configuration. In analyzed versions, the dependent packages did not use the malicious code but were clearly prepared for the supply chain attack. The related GitHub account faked the activity by publishing repositories with backdated commits (the account was created after any of the commits).
No fix · Remove and contain
pip uninstall neutrl-coreSources