Vulnerabilities in pkg:pypi/py-bcrypt

PACKAGE
Advisory Identifier: GHSA-r838-q6jp-58xx
Advisory Summary

CVE-2013-1895 is a HIGH (CVSS 7.5) improper restriction of excessive authentication vulnerability (CWE-307: Improper Restriction of Excessive Authentication Attempts) affecting Py bcrypt libraries in the PyPI ecosystem. The issue involves improper restriction of excessive authentication attempts in py-bcrypt. Remediation is available by upgrading affected packages to version 0.3.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/py-bcrypt

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-r838-q6jp-58xx CVE-2013-1895 HIGH Improper Restriction of Excessive Authentication Attempts in py-bcrypt

CVE-2013-1895 at a Glance

CVE Identifier CVE-2013-1895
GHSA Identifier GHSA-r838-q6jp-58xx
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-307: Improper Restriction of Excessive Authentication Attempts
Affected Product Py bcrypt
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:N/I:H/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 None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2013-1895

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

py-bcrypt fixed: 0.3
pip install py-bcrypt>=0.3
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 py-bcrypt

How to Check if You Are Affected

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

pip show py-bcrypt

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-307: Improper Restriction of Excessive Authentication Attempts, where the product does not implement sufficient measures to prevent multiple failed authentication attempts within a short time frame. In Py bcrypt, 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 py-bcrypt module before 0.3 for Python does not properly handle concurrent memory access, which allows attackers to bypass authentication via multiple authentication requests, which trigger the password hash to be overwritten.

CVE-2013-1895 Affected Py bcrypt Versions

1 component(s)
Fixed Versions:
0.3
Product / Package Ecosystem Affected Versions Fixed Version
py-bcrypt
PyPI
< 0.3
0.3

References

Frequently Asked Questions

What is CVE-2013-1895?
CVE-2013-1895 is a security vulnerability in Py bcrypt involving Improper Restriction of Excessive Authentication Attempts in py-bcrypt under CWE-307: Improper Restriction of Excessive Authentication Attempts.
Which Py bcrypt versions are affected?
Affected versions include releases prior to 0.3 across affected packages: py-bcrypt.
What version fixes CVE-2013-1895?
Upgrading to 0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is py-bcrypt affected?
Yes, py-bcrypt is affected in releases prior to 0.3. Upgrade your dependency to 0.3 or later.
What is the CVSS score of CVE-2013-1895?
CVE-2013-1895 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:N/I:H/A:N.
What CWE is associated with CVE-2013-1895?
CVE-2013-1895 is classified under CWE-307: Improper Restriction of Excessive Authentication Attempts (The product does not implement sufficient measures to prevent multiple failed authentication attempts within a short time frame.).
How can I check PyPI dependencies for CVE-2013-1895?
Run the dependency tree command: 'pip show py-bcrypt'. 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-r838-q6jp-58xx",
  "modified" : "2024-10-21T20:06:57Z",
  "published" : "2021-10-12T16:31:22Z",
  "aliases" : [ "CVE-2013-1895" ],
  "summary" : "Improper Restriction of Excessive Authentication Attempts in py-bcrypt",
  "details" : "The py-bcrypt module before 0.3 for Python does not properly handle concurrent memory access, which allows attackers to bypass authentication via multiple authentication requests, which trigger the password hash to be overwritten.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "py-bcrypt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2013-1895"
  }, {
    "type" : "WEB",
    "url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/83039"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-r838-q6jp-58xx"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/grnet/python-bcrypt"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/py-bcrypt/PYSEC-2020-249.yaml"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2013-April/101382.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.fedoraproject.org/pipermail/package-announce/2013-April/101387.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2013/03/26/2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-307" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-08T23:00:17Z",
    "nvd_published_at" : "2020-01-28T15:15:00Z"
  }
}