CVE-2021-43572
📋 TL;DR
This vulnerability in the Stark Bank Python ECDSA library allows attackers to forge digital signatures on arbitrary messages due to missing validation of non-zero signatures. Any application using this library for cryptographic signature verification is affected, potentially compromising authentication, authorization, and data integrity mechanisms.
💻 Affected Systems
- starkbank-ecdsa-python
- ecdsa-python
📦 What is this software?
Ecdsa Python by Starkbank
⚠️ Risk & Real-World Impact
Worst Case
Complete compromise of systems relying on ECDSA signatures for authentication, allowing attackers to impersonate legitimate users, authorize fraudulent transactions, or tamper with signed data without detection.
Likely Case
Authentication bypass in applications using this library for signature verification, potentially leading to unauthorized access to sensitive systems or data manipulation.
If Mitigated
Limited impact if additional security controls like multi-factor authentication, rate limiting, or transaction monitoring are in place to detect anomalous signature patterns.
🎯 Exploit Status
Technical advisory includes proof-of-concept demonstrating signature forgery. The simplicity of the vulnerability makes weaponization straightforward.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.0.1
Vendor Advisory: https://github.com/starkbank/ecdsa-python/releases/tag/v2.0.1
Restart Required: No
Instructions:
1. Update the starkbank-ecdsa package using pip: pip install starkbank-ecdsa>=2.0.1
2. Verify the update with: pip show starkbank-ecdsa
3. Test signature verification functionality in your application
4. No service restart required for Python applications, but ensure all processes use the updated library
🔧 Temporary Workarounds
Manual signature validation
allAdd custom validation to check that signatures are non-zero before calling the verify function
# Python code snippet to add before verify calls
if signature == 0 or signature is None:
raise ValueError('Invalid signature: zero or None')
🧯 If You Can't Patch
- Implement additional authentication layers (MFA, IP whitelisting) for operations requiring signature verification
- Monitor for anomalous signature patterns and implement transaction validation checks outside the vulnerable library
🔍 How to Verify
Check if Vulnerable:
Check if your Python environment has starkbank-ecdsa version <2.0.1 installed
Check Version:
pip show starkbank-ecdsa | grep Version
Verify Fix Applied:
Verify starkbank-ecdsa version is 2.0.1 or higher and test signature verification with known valid and invalid signatures
📡 Detection & Monitoring
Log Indicators:
- Failed signature verification attempts with zero-value signatures
- Successful authentications with suspicious signature patterns
- Unusual transaction volumes from single signatures
Network Indicators:
- Increased authentication requests with similar signature patterns
- Traffic spikes to signature verification endpoints
SIEM Query:
source="application_logs" AND (signature="0" OR signature="null") AND action="verify"
🔗 References
- https://github.com/starkbank/ecdsa-python/commit/d136170666e9510eb63c2572551805807bd4c17f
- https://github.com/starkbank/ecdsa-python/releases/tag/v2.0.1
- https://research.nccgroup.com/2021/11/08/technical-advisory-arbitrary-signature-forgery-in-stark-bank-ecdsa-libraries/
- https://github.com/starkbank/ecdsa-python/commit/d136170666e9510eb63c2572551805807bd4c17f
- https://github.com/starkbank/ecdsa-python/releases/tag/v2.0.1
- https://research.nccgroup.com/2021/11/08/technical-advisory-arbitrary-signature-forgery-in-stark-bank-ecdsa-libraries/