Vulnerabilities in pkg:pypi/pycrypto

PACKAGE
Advisory Identifier: GHSA-x377-f64p-hf5j
Advisory Summary

CVE-2013-1445 is a HIGH (CVSS 7.5) pycrypto does not properly reseed vulnerability (CWE-332: Insufficient Entropy in PRNG) affecting Pycrypto libraries in the PyPI ecosystem. The issue involves pycrypto does not properly reseed prng before allowing access. Remediation is available by upgrading affected packages to version 2.6.1.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/pycrypto

3 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-x377-f64p-hf5j CVE-2013-1445 HIGH PyCrypto does not properly reseed PRNG before allowing access
GHSA-cq27-v7xp-c356 CVE-2013-7459 CRITICAL Buffer Overflow in pycrypto
GHSA-6528-wvf6-f6qg CVE-2018-6594 HIGH Pycrypto generates weak key parameters

CVE-2013-1445 at a Glance

CVE Identifier CVE-2013-1445
GHSA Identifier GHSA-x377-f64p-hf5j
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-332: Insufficient Entropy in PRNG
Affected Product Pycrypto
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2013-1445

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

pycrypto fixed: 2.6.1
pip install pycrypto>=2.6.1
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 pycrypto

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2013-1445, inspect your installed packages using pip:

pip show pycrypto

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-332: Insufficient Entropy in PRNG, where the lack of entropy available for, or used by, a pseudo-random number generator (prng) can be a stability and security threat. In Pycrypto, 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 Crypto.Random.atfork function in PyCrypto before 2.6.1 does not properly reseed the pseudo-random number generator (PRNG) before allowing a child process to access it, which makes it easier for context-dependent attackers to obtain sensitive information by leveraging a race condition in which a child process is created and accesses the PRNG within the same rate-limit period as another process.

CVE-2013-1445 Affected Pycrypto Versions

1 component(s)
Fixed Versions:
2.6.1
Product / Package Ecosystem Affected Versions Fixed Version
pycrypto
PyPI
< 2.6.1
2.6.1

References

Frequently Asked Questions

What is CVE-2013-1445?
CVE-2013-1445 is a security vulnerability in Pycrypto involving PyCrypto does not properly reseed PRNG before allowing access under CWE-332: Insufficient Entropy in PRNG.
Which Pycrypto versions are affected?
Affected versions include releases prior to 2.6.1 across affected packages: pycrypto.
What version fixes CVE-2013-1445?
Upgrading to 2.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pycrypto affected?
Yes, pycrypto is affected in releases prior to 2.6.1. Upgrade your dependency to 2.6.1 or later.
What is the CVSS score of CVE-2013-1445?
CVE-2013-1445 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2013-1445?
CVE-2013-1445 is classified under CWE-332: Insufficient Entropy in PRNG (The lack of entropy available for, or used by, a Pseudo-Random Number Generator (PRNG) can be a stability and security threat.).
How can I check PyPI dependencies for CVE-2013-1445?
Run the dependency tree command: 'pip show pycrypto'. 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-x377-f64p-hf5j",
  "modified" : "2024-10-21T20:27:56Z",
  "published" : "2022-05-17T04:59:18Z",
  "aliases" : [ "CVE-2013-1445" ],
  "summary" : "PyCrypto does not properly reseed PRNG before allowing access",
  "details" : "The Crypto.Random.atfork function in PyCrypto before 2.6.1 does not properly reseed the pseudo-random number generator (PRNG) before allowing a child process to access it, which makes it easier for context-dependent attackers to obtain sensitive information by leveraging a race condition in which a child process is created and accesses the PRNG within the same rate-limit period as another process.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pycrypto"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-1445"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dlitz/pycrypto/commit/19dcf7b15d61b7dc1a125a367151de40df6ef175"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pycrypto/pycrypto"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pycrypto/PYSEC-2013-29.yaml"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2013/dsa-2781"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2013/10/17/3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-332" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-22T22:55:06Z",
    "nvd_published_at" : "2013-10-26T17:55:00Z"
  }
}