bcoin@0.12.1

Vulnerabilities

3 via 3 paths

Dependencies

6

Source

npm

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
  • 2
Status
  • 3
  • 0
  • 0

high severity

Cryptographic Issues

  • Vulnerable module: elliptic
  • Introduced through: elliptic@0.13.2

Detailed paths

  • Introduced through: bcoin@0.12.1 elliptic@0.13.2
    Remediation: Upgrade to bcoin@1.0.0.

Overview

elliptic is a Fast elliptic-curve cryptography in a plain javascript implementation.

Affected versions of this package are vulnerable to Cryptographic Issues. Elliptic allows ECDSA signature malleability via variations in encoding, leading \0 bytes, or integer overflows. This could conceivably have a security-relevant impact if an application relied on a single canonical signature.

PoC

var crypto = require('crypto')
var EC = require('elliptic').ec;
var ec = new EC('secp256k1');

var obj = require("./poc_ecdsa_secp256k1_sha256_test.json");

for (let testGroup of obj.testGroups) {

    var key = ec.keyFromPublic(testGroup.key.uncompressed, 'hex');
    
    for(let test of testGroup.tests) {
     console.log("[*] Test " + test.tcId + " result: " + test.result)

     msgHash = crypto.createHash('sha256').update(Buffer.from(test.msg, 'hex')).digest();
     
     try {
      result = key.verify(msgHash, Buffer.from(test.sig, 'hex'));

     if (result == true) {
      if (test.result == "valid" || test.result == "acceptable")
       console.log("Result: PASS");
      else
       console.log("Result: FAIL")     
     }

     if (result == false) {
      if (test.result == "valid" || test.result == "acceptable")
       console.log("Result: FAIL");
      else
       console.log("Result: PASS")     
     }



     } catch (e) {
      console.log("ERROR - VERIFY: " + e)

      if (test.result == "valid" || test.result == "acceptable")
       console.log("Result: FAIL");
      else
       console.log("Result: PASS")     



     }


    }

}

Remediation

Upgrade elliptic to version 6.5.3 or higher.

References

medium severity

Cryptographic Issues

  • Vulnerable module: elliptic
  • Introduced through: elliptic@0.13.2

Detailed paths

  • Introduced through: bcoin@0.12.1 elliptic@0.13.2
    Remediation: Upgrade to bcoin@1.0.0.

Overview

elliptic is a Fast elliptic-curve cryptography in a plain javascript implementation.

Affected versions of this package are vulnerable to Cryptographic Issues via the secp256k1 implementation in elliptic/ec/key.js. There is no check to confirm that the public key point passed into the derive function actually exists on the secp256k1 curve. This results in the potential for the private key used in this implementation to be revealed after a number of ECDH operations are performed.

Remediation

Upgrade elliptic to version 6.5.4 or higher.

References

medium severity

Timing Attack

  • Vulnerable module: elliptic
  • Introduced through: elliptic@0.13.2

Detailed paths

  • Introduced through: bcoin@0.12.1 elliptic@0.13.2
    Remediation: Upgrade to bcoin@1.0.0.

Overview

elliptic is a Fast elliptic-curve cryptography in a plain javascript implementation.

Affected versions of this package are vulnerable to Timing Attack. Practical recovery of the long-term private key generated by the library is possible under certain conditions. Leakage of bit-length of a scalar during scalar multiplication is possible on an elliptic curve which might allow practical recovery of the long-term private key.

Remediation

Upgrade elliptic to version 6.5.2 or higher.

References