Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. ctx
  4. ›
  5. GMS-2022-1520

GMS-2022-1520: Malware in ctx

May 25, 2022 (updated May 26, 2022)

The ctx hosted project on PyPI was taken over via user account compromise and replaced with a malicious project which contained runtime code that collected the content of os.environ.items() when instantiating Ctx objects. The captured environment variables were sent as a base64 encoded query parameter to a heroku application running at https://anti-theft-web.herokuapp.com.

If you installed the package between May 14, 2022 and May 24, 2022, and your environment variables contain sensitive data like passwords and API keys (like AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY), we advise you to rotate your passwords and keys, then perform an audit to determine if they were exploited.

References

  • github.com/advisories/GHSA-4g82-3jcr-q52w
  • github.com/figlief/ctx
  • isc.sans.edu/forums/diary/ctx+Python+Library+Updated+with+Extra+Features/28678/
  • portswigger.net/daily-swig/malicious-python-library-ctx-removed-from-pypi-repo
  • python-security.readthedocs.io/pypi-vuln/index-2022-05-24-ctx-domain-takeover.html

Code Behaviors & Features

Detect and mitigate GMS-2022-1520 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions up to 0.1.4

Solution

Unfortunately, there is no solution available yet.

Source file

pypi/ctx/GMS-2022-1520.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:23 +0000.