CVE-2019-14853: Ecdsa Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-pwfw-mgfj-7g3g
CVSS 7.5
CWE-755 CWE-391
Published
Advisory Summary

CVE-2019-14853 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-755: Improper Handling of Exceptional Conditions) affecting Ecdsa libraries in the PyPI ecosystem. The issue involves ecdsa denial of service vulnerability in signature verification and signature malleability. Remediation is available by upgrading affected packages to version 0.13.3.

CVE-2019-14853 at a Glance

CVE Identifier CVE-2019-14853
GHSA Identifier GHSA-pwfw-mgfj-7g3g
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-755: Improper Handling of Exceptional Conditions
Affected Product Ecdsa
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2019-14853

To remediate this vulnerability, upgrade all affected Ecdsa dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ecdsa fixed: 0.13.3
pip install ecdsa>=0.13.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show ecdsa

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2019-14853, inspect your installed packages using pip:

pip show ecdsa

Analyze the terminal output to locate any version of Ecdsa in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.3), your application is affected.

Note: The pip show ecdsa command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-755: Improper Handling of Exceptional Conditions, where the product does not handle or incorrectly handles an exceptional condition. In Ecdsa, 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

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

CVE-2019-14853 Affected Ecdsa Versions

1 component(s)
Fixed Versions:
0.13.3
Product / Package Ecosystem Affected Versions Fixed Version
ecdsa
PyPI
< 0.13.3
0.13.3

References

Frequently Asked Questions

What is CVE-2019-14853?
CVE-2019-14853 is a security vulnerability in Ecdsa involving ecdsa Denial of Service vulnerability in signature verification and signature malleability under CWE-755: Improper Handling of Exceptional Conditions.
Which Ecdsa versions are affected?
Affected versions include releases prior to 0.13.3 across affected packages: ecdsa.
What version fixes CVE-2019-14853?
Upgrading to 0.13.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ecdsa affected?
Yes, ecdsa is affected in releases prior to 0.13.3. Upgrade your dependency to 0.13.3 or later.
What is the CVSS score of CVE-2019-14853?
CVE-2019-14853 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2019-14853?
CVE-2019-14853 is classified under CWE-755: Improper Handling of Exceptional Conditions (The product does not handle or incorrectly handles an exceptional condition.).
How can I check PyPI dependencies for CVE-2019-14853?
Run the dependency tree command: 'pip show ecdsa'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pwfw-mgfj-7g3g",
  "modified" : "2024-09-20T16:47:14Z",
  "published" : "2019-10-08T16:30:17Z",
  "aliases" : [ "CVE-2019-14853" ],
  "summary" : "ecdsa Denial of Service vulnerability in signature verification and signature malleability",
  "details" : "## possible DoS in signature verification and signature malleability \n\n### Impact\nCode 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\n\nCode 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.\n\nAll 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.\n\n### Patches\nThe patches have been merged to `master` branch in https://github.com/warner/python-ecdsa/pull/115.\nThe backported patches for a release in the 0.13 branch are in https://github.com/warner/python-ecdsa/pull/124\n\nThey are part of the 0.13.3 release.\n\nThere are no plans to backport them to earlier releases.\n\n### Workarounds\nIt 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.\n\nTo 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.\n\n### References\nhttps://en.bitcoinwiki.org/wiki/Transaction_Malleability\n\n### For more information\nIf you have any questions or comments about this advisory please open an issue in [python-ecdsa](https://github.com/warner/python-ecdsa/issues) project.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ecdsa"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.13.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/warner/python-ecdsa/security/advisories/GHSA-pwfw-mgfj-7g3g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-14853"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-14853"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ecdsa/PYSEC-2019-177.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/warner/python-ecdsa"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/warner/python-ecdsa/releases/tag/python-ecdsa-0.13.3"
  }, {
    "type" : "WEB",
    "url" : "https://seclists.org/bugtraq/2019/Dec/33"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2019/dsa-4588"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-391", "CWE-755" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:41:53Z",
    "nvd_published_at" : "2019-11-26T13:15:00Z"
  }
}