GHSA-r8wq-qrxc-hmcm: Python ldap Denial of Service Vulnerability
MODERATEGHSA-r8wq-qrxc-hmcm is a MODERATE (CVSS 6.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Python ldap libraries in the PyPI ecosystem. The issue involves redos in ldap schema parser. Remediation is available by upgrading affected packages to version 3.4.0.
GHSA-r8wq-qrxc-hmcm at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix GHSA-r8wq-qrxc-hmcm
To remediate this vulnerability, upgrade all affected Python ldap dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install python-ldap>=3.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show python-ldap
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-r8wq-qrxc-hmcm, inspect your installed packages using pip:
pip show python-ldap
Analyze the terminal output to locate any version of Python ldap in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.4.0), your application is affected.
Note: The pip show python-ldap command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Python ldap, 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
GHSA-r8wq-qrxc-hmcm Affected Python ldap Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
python-ldap
|
PyPI |
< 3.4.0
|
3.4.0
|
References
Frequently Asked Questions
What is GHSA-r8wq-qrxc-hmcm?
Which Python ldap versions are affected?
What version fixes GHSA-r8wq-qrxc-hmcm?
Is python-ldap affected?
What is the CVSS score of GHSA-r8wq-qrxc-hmcm?
What CWE is associated with GHSA-r8wq-qrxc-hmcm?
How can I check PyPI dependencies for GHSA-r8wq-qrxc-hmcm?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r8wq-qrxc-hmcm",
"modified" : "2021-11-26T18:26:27Z",
"published" : "2021-11-29T17:58:59Z",
"aliases" : [ ],
"summary" : "ReDoS in LDAP schema parser",
"details" : "https://github.com/python-ldap/python-ldap/issues/424\n\n### Impact\nThe LDAP schema parser of python-ldap 3.3.1 and earlier are vulnerable to a regular expression denial-of-service attack. The issue affects clients that use ``ldap.schema`` package to parse LDAP schema definitions from an untrusted source.\n\n### Patches\nThe upcoming release of python-ldap 3.4.0 will contain a workaround to prevent ReDoS attacks. The schema parser refuses schema definitions with an excessive amount of backslashes.\n\n### Workarounds\nAs a workaround, users can check input for excessive amount of backslashes in schemas. More than a dozen backslashes per line are atypical.\n\n### References\n[CWE-1333](https://cwe.mitre.org/data/definitions/1333.html)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [python-ldap](https://github.com/python-ldap/python-ldap) tracker\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "python-ldap"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/python-ldap/python-ldap/security/advisories/GHSA-r8wq-qrxc-hmcm"
}, {
"type" : "WEB",
"url" : "https://github.com/python-ldap/python-ldap/issues/424"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/python-ldap/python-ldap"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-11-26T18:26:27Z",
"nvd_published_at" : null
}
}