First published: Fri Oct 04 2019(Updated: )
## possible DoS in signature verification and signature malleability ### Impact Code using `VerifyingKey.verify()` and `VerifyingKey.verify_digest()` may receive exceptions other than the documented `BadSignatureError` when signatures are malformed. If those other exceptions are not caught, they may lead to program termination and thus Denial of Service Code using `VerifyingKey.verify()` and `VerifyingKey.verify_digest()` with `sigdecode` option using `ecdsa.util.sigdecode_der` will accept signatures even if they are not properly formatted DER. This makes the signatures malleable. It impacts only applications that later sign the signatures or verify signatures of signatures, e.g. Bitcoin. All versions between 0.5 and 0.13.2 (inclusive) are thought to be vulnerable. Code before 0.5 may be vulnerable but didn't receive extended analysis to rule this issue out. ### Patches The patches have been merged to `master` branch in https://github.com/warner/python-ecdsa/pull/115. The backported patches for a release in the 0.13 branch are in https://github.com/warner/python-ecdsa/pull/124 They are part of the 0.13.3 release. There are no plans to backport them to earlier releases. ### Workarounds It may be possible to prevent the Denial of Service by catching also `UnexpectedDER`, `IndexError` and `AssertionError` exceptions. That list hasn't been verified to be complete though. If those exceptions are raised, the signature verification process should consider the signature to be invalid. To remediate signature malleability and the Denial of Service vulnerability, it may be possible to first verify that the signature is properly DER formatted ECDSA-Sig-Value, as defined in [RFC3279](https://tools.ietf.org/html/rfc3279), before passing it to `verify()` or `verify_digest()` methods. If the signature is determined to not follow the DER or encode a different structure, the signature verification process should consider the signature to be invalid. ### References https://en.bitcoinwiki.org/wiki/Transaction_Malleability ### For more information If you have any questions or comments about this advisory please open an issue in [python-ecdsa](https://github.com/warner/python-ecdsa/issues) project.
Credit: secalert@redhat.com secalert@redhat.com
Affected Software | Affected Version | How to fix |
---|---|---|
pip/ecdsa | <0.13.3 | 0.13.3 |
Python-ecdsa Project Python-ecdsa | <0.13.3 | |
redhat/python-ecdsa | <0.13.3 | 0.13.3 |
debian/python-ecdsa | 0.13-3+deb10u1 0.16.1-1 0.18.0-3 |
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
The vulnerability ID of this security flaw is CVE-2019-14853.
CVE-2019-14853 has a severity rating of 7.5 (high).
Code using VerifyingKey.verify() and VerifyingKey.verify_digest() may receive exceptions other than the documented BadSignatureError when signatures are malformed.
To fix this vulnerability, update to python-ecdsa version 0.13.3 or later.
You can find more information about CVE-2019-14853 on the GitHub security advisory page (https://github.com/warner/python-ecdsa/security/advisories/GHSA-pwfw-mgfj-7g3g) and the NIST National Vulnerability Database (https://nvd.nist.gov/vuln/detail/CVE-2019-14853).