PyPI

The aiocpa PyPI Supply Chain Attack

Updated 5 Oct 2026 · Incident date 20 Nov 2024

aiocpa 0.1.13 and 0.1.14 on PyPI hid obfuscated code that sent Crypto Pay API tokens to a Telegram bot on 20 November 2024.

aiocpa is a Python client for the Crypto Pay API. The PyPI packages carried the malicious code. The public GitHub repository did not.

What happened

The attacker published two poisoned releases to PyPI.

  • The code sits in cryptopay/utils/sync.py, wrapped in about 50 layers of obfuscation.
  • On import, it replaces the constructor of the CryptoPay class.
  • It sends the constructor arguments, which include the API token, to a Telegram bot in an HTTP request.

Version 0.1.13 appeared at 18:04 UTC on 20 November 2024 and 0.1.14 at 18:50 UTC. PyPI Security quarantined the package on 21 November at 18:29 UTC.

Affected versions

  • aiocpa 0.1.13 (malicious, released 20 November 2024).
  • aiocpa 0.1.14 (malicious, released 20 November 2024).
  • aiocpa 0.1.0 to 0.1.12 (safe, according to PyPI Security).
  • No clean release exists after 0.1.12.

Indicators of compromise

  • Package name aiocpa at version 0.1.13 or 0.1.14.
  • The file cryptopay/utils/sync.py, with the malicious code near line 44.
  • Outbound requests to api.telegram.org with a /bot<id>/sendMessage path and chat_id=6526761736.
  • SHA1 of 0.1.13 files listed by ReversingLabs: a1187d2a4acfe8ddaee3c7be79a9bb838142903a and 7007be259829d72e73ff63ad409770ca56cfc418.
  • SHA1 of 0.1.14 files listed by ReversingLabs: fc36c157075dd4302f71ed2660e19a61016b085c and 01f7db47368bffa279fb15c688518774454650cf.

How to check

Check the version in each Python environment, including virtual environments and containers.

pip show aiocpa
pip freeze | grep -i aiocpa

Search lock files and image layers for the package.

grep -rn aiocpa requirements*.txt poetry.lock Pipfile.lock pyproject.toml

What to do now

  1. Run pip uninstall aiocpa in every environment.
  2. Revoke and replace every Crypto Pay API token that an affected program used.
  3. Check your Crypto Pay account for payments you did not make.
  4. Pin dependency versions and use hash checking, for example pip install --require-hashes.

What Vigilance would show

These examples show an install hold and the corresponding owner report.

Example install message

Vigilance blocked `aiocpa` 0.1.13. This version is too new or changed in a way Vigilance must check first.

Example owner report

Bad update

aiocpa 0.1.13

A payments library gained hidden scrambled code that unpacked itself and sent the owner's payment keys to a chat bot.

See what to do now.

No security team? See who reads the alert.

Frequently asked questions

How many downloads did aiocpa have?

ReversingLabs reports more than 10,000 downloads before removal.

How did researchers find it?

ReversingLabs found the package on 21 November 2024 with machine learning threat hunting and reported it to PyPI.

Sources

  1. blog.pypi.org/posts/2024-11-25-aiocpa-attack-analysis/
  2. reversinglabs.com/blog/malicious-pypi-crypto-pay-package-aiocpa-implants-infostealer-code

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 172 attacks in the library · What is a supply chain attack? · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start the free 14-day trialBrowse the attack library