Vulnerabilities in pkg:pypi/ctx

PACKAGE
Advisory Summary

GHSA-67r3-h899-9w95 is a CRITICAL embedded malicious code vulnerability (General Security Weakness) affecting Ctx libraries in the PyPI ecosystem. The issue involves embedded malicious code in ctx. Remediation is available in the latest vendor maintenance releases.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/ctx

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/ctx. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-67r3-h899-9w95 - CRITICAL Embedded Malicious Code in ctx
GHSA-4g82-3jcr-q52w - CRITICAL Malware in ctx

GHSA-67r3-h899-9w95 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-67r3-h899-9w95
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Ctx
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-67r3-h899-9w95

To remediate this vulnerability, upgrade all affected Ctx dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ctx fixed: Latest secure release
pip install ctx>=Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show ctx

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-67r3-h899-9w95, inspect your installed packages using pip:

pip show ctx

Analyze the terminal output to locate any version of Ctx in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The pip show ctx command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Ctx, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The ctx hosted project on PyPI was taken over via user account compromise and replaced with a malicious project which contained runtime code which collected the content of os.environ.items() when instantiating Ctx objects.

GHSA-67r3-h899-9w95 Affected Ctx Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
ctx
PyPI
≥ 0.1.2-1

References

Frequently Asked Questions

What is GHSA-67r3-h899-9w95?
GHSA-67r3-h899-9w95 is a security vulnerability in Ctx involving Embedded Malicious Code in ctx under General Security Weakness.
Which Ctx versions are affected?
Affected versions include releases prior to current release patches across affected packages: ctx.
What version fixes GHSA-67r3-h899-9w95?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is ctx affected?
Yes, ctx is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-67r3-h899-9w95?
GHSA-67r3-h899-9w95 is classified under General Security Weakness.
How can I check PyPI dependencies for GHSA-67r3-h899-9w95?
Run the dependency tree command: 'pip show ctx'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-67r3-h899-9w95",
  "modified" : "2022-06-02T15:46:06Z",
  "published" : "2022-06-02T15:46:06Z",
  "aliases" : [ ],
  "summary" : "Embedded Malicious Code in ctx",
  "details" : "The ctx hosted project on PyPI was taken over via user account compromise and replaced with a malicious project which contained runtime code which collected the content of os.environ.items() when instantiating Ctx objects.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ctx"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.2-1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ctx/PYSEC-2022-199.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://python-security.readthedocs.io/pypi-vuln/index-2022-05-24-ctx-domain-takeover.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-02T15:46:06Z",
    "nvd_published_at" : null
  }
}