CVE-2019-14853: High severity Python-ecdsa Project Python-ecdsa vulnerability

Published Oct 4, 2019
·
Updated

possible DoS in signature verification and signature malleability

Impact Code using VerifyingKey.verify() and VerifyingKey.verifydigest() 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.verifydigest() with sigdecode option using ecdsa.util.sigdecodeder 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, before passing it to verify() or verifydigest() 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/TransactionMalleability

For more information If you have any questions or comments about this advisory please open an issue in python-ecdsa project.

Other sources

A flaw was found in python-ecdsa. Unexpected and undocumented exceptions can be raised during signature decoding may lead to denial of service in some cases. All the versions between at least 0.5 and 0.13.2 are thought to be vulnerable.

Upstream issue:

https://github.com/warner/python-ecdsa/issues/114

Upstream patch:

https://github.com/warner/python-ecdsa/pull/115

References:

https://github.com/warner/python-ecdsa/blob/bb359d32e93acc3eb4d216aff4ba0e7531599cfb/ecdsa/keys.py#L98-L113

Red Hat

An error-handling flaw was found in python-ecdsa before version 0.13.3. During signature decoding, malformed DER signatures could raise unexpected exceptions (or no exceptions at all), which could lead to a denial of service.

Affected Software

4 affected componentsFixes available
debian/python-ecdsa
0.13-3+deb10u10.16.1-10.18.0-3
redhat/python-ecdsa<0.13.3
0.13.3
pip/ecdsa<0.13.3
0.13.3
Python-ecdsa Project Python-ecdsa<0.13.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/python-ecdsa to a version that resolves this vulnerability.

    Fixed in 0.13-3+deb10u1Fixed in 0.16.1-1Fixed in 0.18.0-3
  2. Upgrade

    Upgrade redhat/python-ecdsa to a version that resolves this vulnerability.

    Fixed in 0.13.3
  3. Upgrade

    Upgrade pip/ecdsa to a version that resolves this vulnerability.

    Fixed in 0.13.3
  4. Upgrade

    Upgrade debian/python-ecdsa to a version that resolves this vulnerability.

    Fixed in 0.13-3+deb10u1
  5. Upgrade

    Upgrade debian/python-ecdsa to a version that resolves this vulnerability.

    Fixed in 0.16.1-1
  6. Upgrade

    Upgrade debian/python-ecdsa to a version that resolves this vulnerability.

    Fixed in 0.18.0-3
  7. Configuration

    Before calling VerifyingKey.verify() or VerifyingKey.verify_digest() (including when using ecdsa.util.sigdecode_der), validate that the signature is properly DER-formatted ECDSA-Sig-Value as defined in RFC3279. Additionally, wrap calls to verify() and verify_digest() in try/except blocks that catch UnexpectedDER, IndexError, and AssertionError and treat those exceptions as signature verification failures to avoid program termination (Denial of Service).

    Applications using python-ecdsa VerifyingKey.verify()/verify_digest() signature_validation = validate DER ECDSA-Sig-Value per RFC3279 before verification; catch UnexpectedDER, IndexError, AssertionError and treat signature as invalid

Event History

Oct 8, 2019
Advisory Published
via GitHub·04:30 PM
Nov 26, 2019
CVE Published
via MITRE·12:06 PM
Data Sourced
via MITRE·12:06 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·01:15 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the vulnerability ID of this security flaw?

The vulnerability ID of this security flaw is CVE-2019-14853.

2

What is the severity rating of CVE-2019-14853?

CVE-2019-14853 has a severity rating of 7.5 (high).

3

How does this vulnerability impact code using VerifyingKey.verify() and VerifyingKey.verify_digest()?

Code using VerifyingKey.verify() and VerifyingKey.verify_digest() may receive exceptions other than the documented BadSignatureError when signatures are malformed.

4

How can the vulnerability be fixed?

To fix this vulnerability, update to python-ecdsa version 0.13.3 or later.

5

Where can I find more information about CVE-2019-14853?

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).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203