CVE-2023-50781: M2crypto M2crypto Bleichenbacher Timing Attack - Vulnerability

MODERATE
Advisory Identifier: GHSA-944j-8ch6-rf6x
CVSS 5.9
CWE-203 CWE-385 CWE-208
Published
Advisory Summary

CVE-2023-50781 is a MODERATE (CVSS 5.9) m2crypto bleichenbacher timing attack - vulnerability (CWE-203: Observable Discrepancy) affecting M2crypto libraries in the PyPI ecosystem. The issue involves m2crypto bleichenbacher timing attack - incomplete fix for cve-2020-25657. Remediation is available in the latest vendor maintenance releases.

CVE-2023-50781 at a Glance

CVE Identifier CVE-2023-50781
GHSA Identifier GHSA-944j-8ch6-rf6x
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-203: Observable Discrepancy
Affected Product M2crypto
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
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-2023-50781

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

m2crypto fixed: Latest secure release
pip install m2crypto>=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 m2crypto

How to Check if You Are Affected

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

pip show m2crypto

Analyze the terminal output to locate any version of M2crypto 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 m2crypto command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. In M2crypto, 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

A flaw was found in m2crypto. This issue may allow a remote attacker to decrypt captured messages in TLS servers that use RSA key exchanges, which may lead to exposure of confidential or sensitive data.

CVE-2023-50781 Affected M2crypto Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
m2crypto
PyPI
≤ 0.40.1

References

Frequently Asked Questions

What is CVE-2023-50781?
CVE-2023-50781 is a security vulnerability in M2crypto involving m2crypto Bleichenbacher timing attack - incomplete fix for CVE-2020-25657 under CWE-203: Observable Discrepancy.
Which M2crypto versions are affected?
Affected versions include releases prior to current release patches across affected packages: m2crypto.
What version fixes CVE-2023-50781?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is m2crypto affected?
Yes, m2crypto is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2023-50781?
CVE-2023-50781 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2023-50781?
CVE-2023-50781 is classified under CWE-203: Observable Discrepancy (The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.).
How can I check PyPI dependencies for CVE-2023-50781?
Run the dependency tree command: 'pip show m2crypto'. 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-944j-8ch6-rf6x",
  "modified" : "2026-02-27T20:57:08Z",
  "published" : "2024-02-05T21:30:31Z",
  "aliases" : [ "CVE-2023-50781" ],
  "summary" : "m2crypto Bleichenbacher timing attack - incomplete fix for CVE-2020-25657",
  "details" : "A flaw was found in m2crypto. This issue may allow a remote attacker to decrypt captured messages in TLS servers that use RSA key exchanges, which may lead to exposure of confidential or sensitive data.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "m2crypto"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.40.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-50781"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2023-50781"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2254426"
  }, {
    "type" : "PACKAGE",
    "url" : "https://gitlab.com/m2crypto/m2crypto"
  }, {
    "type" : "WEB",
    "url" : "https://gitlab.com/m2crypto/m2crypto/-/issues/342"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-203", "CWE-208", "CWE-385" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-05T22:41:57Z",
    "nvd_published_at" : "2024-02-05T21:15:10Z"
  }
}