CVE-2021-39182: Enrocrypt Improper Hashing Vulnerability

HIGH
Advisory Identifier: GHSA-35m5-8cvj-8783
CVSS 7.5
CWE-327 CWE-326 CWE-916 CWE-328
Published
Advisory Summary

CVE-2021-39182 is a HIGH (CVSS 7.5) improper hashing vulnerability (CWE-327: Use of a Broken or Risky Cryptographic Algorithm) affecting Enrocrypt libraries in the PyPI ecosystem. The issue involves improper hashing in enrocrypt. Remediation is available by upgrading affected packages to version 1.1.4.

CVE-2021-39182 at a Glance

CVE Identifier CVE-2021-39182
GHSA Identifier GHSA-35m5-8cvj-8783
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-327: Use of a Broken or Risky Cryptographic Algorithm
Affected Product Enrocrypt
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-2021-39182

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

enrocrypt fixed: 1.1.4
pip install enrocrypt>=1.1.4
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 enrocrypt

How to Check if You Are Affected

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

pip show enrocrypt

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm, where the product uses a broken or risky cryptographic algorithm or protocol. In Enrocrypt, 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

### Impact The vulnerability is we used MD5 hashing Algorithm In our hashing file. If anyone who is a beginner(and doesn't know about hashes) can face problems as MD5 is considered a Insecure Hashing Algorithm. ### Patches The vulnerability is patched in v1.1.4 of the product, the users can upgrade to version 1.1.4. ### Workarounds If u specifically want a version and don't want to upgrade, you can remove the `MD5` hashing function from the file `hashing.py` and this vulnerability will be gone ### References https://www.cybersecurity-help.cz/vdb/cwe/916/ https://www.cybersecurity-help.cz/vdb/cwe/327/ https://www.cybersecurity-help.cz/vdb/cwe/328/ https://www.section.io/engineering-education/what-is-md5/ https://www.johndcook.com/blog/2019/01/24/reversing-an-md5-hash/ ### For more information If you have any questions or comments about this advisory: * Open an issue in [**Enrocrypt's Official Repo**](http://www.github.com/Morgan-Phoenix/EnroCrypt) * Create a Discussion in [**Enrocrypt's Official Repo**](http://www.github.com/Morgan-Phoenix/EnroCrypt)

CVE-2021-39182 Affected Enrocrypt Versions

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

References

Frequently Asked Questions

What is CVE-2021-39182?
CVE-2021-39182 is a security vulnerability in Enrocrypt involving Improper hashing in enrocrypt under CWE-327: Use of a Broken or Risky Cryptographic Algorithm.
Which Enrocrypt versions are affected?
Affected versions include releases prior to 1.1.4 across affected packages: enrocrypt.
What version fixes CVE-2021-39182?
Upgrading to 1.1.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is enrocrypt affected?
Yes, enrocrypt is affected in releases prior to 1.1.4. Upgrade your dependency to 1.1.4 or later.
What is the CVSS score of CVE-2021-39182?
CVE-2021-39182 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-2021-39182?
CVE-2021-39182 is classified under CWE-327: Use of a Broken or Risky Cryptographic Algorithm (The product uses a broken or risky cryptographic algorithm or protocol.).
How can I check PyPI dependencies for CVE-2021-39182?
Run the dependency tree command: 'pip show enrocrypt'. 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-35m5-8cvj-8783",
  "modified" : "2024-09-20T16:50:32Z",
  "published" : "2021-11-10T16:28:46Z",
  "aliases" : [ "CVE-2021-39182" ],
  "summary" : "Improper hashing in enrocrypt",
  "details" : "### Impact\nThe vulnerability is we used MD5 hashing Algorithm In our hashing file. If anyone who is a beginner(and doesn't know about hashes)  can face problems as MD5 is considered a Insecure Hashing Algorithm. \n\n### Patches\nThe vulnerability is patched in v1.1.4 of the product, the users can upgrade to version 1.1.4.\n\n### Workarounds\nIf u specifically want a version and don't want to upgrade, you can remove the `MD5` hashing function from the file `hashing.py` and this vulnerability will be gone\n\n### References\nhttps://www.cybersecurity-help.cz/vdb/cwe/916/\nhttps://www.cybersecurity-help.cz/vdb/cwe/327/\nhttps://www.cybersecurity-help.cz/vdb/cwe/328/\nhttps://www.section.io/engineering-education/what-is-md5/\nhttps://www.johndcook.com/blog/2019/01/24/reversing-an-md5-hash/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [**Enrocrypt's Official Repo**](http://www.github.com/Morgan-Phoenix/EnroCrypt)\n* Create a Discussion in  [**Enrocrypt's Official Repo**](http://www.github.com/Morgan-Phoenix/EnroCrypt)\n",
  "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" : "enrocrypt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Morgan-Phoenix/EnroCrypt/security/advisories/GHSA-35m5-8cvj-8783"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-39182"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Morgan-Phoenix/EnroCrypt/commit/e652d56ac60eadfc26489ab83927af13a9b9d8ce"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Morgan-Phoenix/EnroCrypt"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/enrocrypt/PYSEC-2021-385.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-326", "CWE-327", "CWE-328", "CWE-916" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-08T18:58:04Z",
    "nvd_published_at" : "2021-11-08T15:15:00Z"
  }
}