CVE-2022-41340: @lionello/secp256k1 js Secp256k1-js Implements ECDSA Without Required Vulnerability

HIGH
Advisory Identifier: GHSA-q3f4-9h4p-vgr3
CVSS 7.5
CWE-347
Published
Advisory Summary

CVE-2022-41340 is a HIGH (CVSS 7.5) secp256k1-js implements ecdsa without required vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting @lionello/secp256k1 js libraries in the npm ecosystem. The issue involves secp256k1-js implements ecdsa without required r and s validation, leading to signature forgery. Remediation is available by upgrading affected packages to version 1.1.0.

CVE-2022-41340 at a Glance

CVE Identifier CVE-2022-41340
GHSA Identifier GHSA-q3f4-9h4p-vgr3
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product @lionello/secp256k1 js
Package Ecosystem npm
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:H/A:N).

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 High (I:H)
Availability None (A:N)

How to Fix CVE-2022-41340

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

@lionello/secp256k1-js fixed: 1.1.0
npm install @lionello/secp256k1-js@1.1.0
Verify Direct and Transitive Dependencies

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

npm ls @lionello/secp256k1-js

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-41340, inspect your project dependencies using npm:

npm ls @lionello/secp256k1-js

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

Note: The npm ls @lionello/secp256k1-js command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In @lionello/secp256k1 js, 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

The secp256k1-js package before 1.1.0 for Node.js implements ECDSA without required r and s validation, leading to signature forgery.

CVE-2022-41340 Affected @lionello/secp256k1 js Versions

1 component(s)
Fixed Versions:
1.1.0
Product / Package Ecosystem Affected Versions Fixed Version
@lionello/secp256k1-js
npm
< 1.1.0
1.1.0

References

Frequently Asked Questions

What is CVE-2022-41340?
CVE-2022-41340 is a security vulnerability in @lionello/secp256k1 js involving secp256k1-js implements ECDSA without required r and s validation, leading to signature forgery under CWE-347: Improper Verification of Cryptographic Signature.
Which @lionello/secp256k1 js versions are affected?
Affected versions include releases prior to 1.1.0 across affected packages: @lionello/secp256k1-js.
What version fixes CVE-2022-41340?
Upgrading to 1.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @lionello/secp256k1-js affected?
Yes, @lionello/secp256k1-js is affected in releases prior to 1.1.0. Upgrade your dependency to 1.1.0 or later.
What is the CVSS score of CVE-2022-41340?
CVE-2022-41340 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:H/A:N.
What CWE is associated with CVE-2022-41340?
CVE-2022-41340 is classified under CWE-347: Improper Verification of Cryptographic Signature (The product does not verify, or incorrectly verifies, the cryptographic signature for data.).
How can I check npm dependencies for CVE-2022-41340?
Run the dependency tree command: 'npm ls @lionello/secp256k1-js'. 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-q3f4-9h4p-vgr3",
  "modified" : "2022-09-29T10:09:03Z",
  "published" : "2022-09-25T00:00:15Z",
  "aliases" : [ "CVE-2022-41340" ],
  "summary" : "secp256k1-js implements ECDSA without required r and s validation, leading to signature forgery",
  "details" : "The secp256k1-js package before 1.1.0 for Node.js implements ECDSA without required r and s validation, leading to signature forgery.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@lionello/secp256k1-js"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41340"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lionello/secp256k1-js/issues/11"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lionello/secp256k1-js/commit/302800f0370b42e360a33774bb808274ac729c2e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lionello/secp256k1-js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lionello/secp256k1-js/compare/1.0.1...1.1.0"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/@lionello/secp256k1-js"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-27T22:34:59Z",
    "nvd_published_at" : "2022-09-24T19:15:00Z"
  }
}