CVE-2022-24759: @chainsafe/libp2p noise Failure To Validate Signature During Vulnerability

HIGH
Advisory Identifier: GHSA-j3ff-xp6c-6gcc
CVSS 8.1
CWE-347
Published
Advisory Summary

CVE-2022-24759 is a HIGH (CVSS 8.1) failure to validate signature during vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting @chainsafe/libp2p noise libraries in the npm ecosystem. The issue involves failure to validate signature during handshake. Remediation is available by upgrading affected packages to version 4.1.2, 5.0.3.

CVE-2022-24759 at a Glance

CVE Identifier CVE-2022-24759
GHSA Identifier GHSA-j3ff-xp6c-6gcc
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-347: Improper Verification of Cryptographic Signature
Affected Product @chainsafe/libp2p noise
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

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

How to Fix CVE-2022-24759

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

@chainsafe/libp2p-noise fixed: 4.1.2
npm install @chainsafe/libp2p-noise@4.1.2
@chainsafe/libp2p-noise fixed: 5.0.3
npm install @chainsafe/libp2p-noise@5.0.3
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 @chainsafe/libp2p-noise

How to Check if You Are Affected

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

npm ls @chainsafe/libp2p-noise

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

Note: The npm ls @chainsafe/libp2p-noise 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 @chainsafe/libp2p noise, 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

### Impact `@chainsafe/libp2p-noise` before 4.1.2 and 5.0.3 was not correctly validating signatures during the handshake process. This may allow a man-in-the-middle to pose as other peers and get those peers banned. ### Patches Users should upgrade to 4.1.2 or 5.0.3 ### Workarounds No workarounds, just patch upgrade ### References https://github.com/ChainSafe/js-libp2p-noise/pull/130

CVE-2022-24759 Affected @chainsafe/libp2p noise Versions

2 component(s)
Fixed Versions:
4.1.25.0.3
Product / Package Ecosystem Affected Versions Fixed Version
@chainsafe/libp2p-noise
npm
< 4.1.2
4.1.2
@chainsafe/libp2p-noise
npm
≥ 5.0.0
< 5.0.3
5.0.3

References

Frequently Asked Questions

What is CVE-2022-24759?
CVE-2022-24759 is a security vulnerability in @chainsafe/libp2p noise involving Failure to validate signature during handshake under CWE-347: Improper Verification of Cryptographic Signature.
Which @chainsafe/libp2p noise versions are affected?
Affected versions include releases prior to 4.1.2, 5.0.3 across affected packages: @chainsafe/libp2p-noise.
What version fixes CVE-2022-24759?
Upgrading to 4.1.2, 5.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @chainsafe/libp2p-noise affected?
Yes, @chainsafe/libp2p-noise is affected in releases prior to 4.1.2, 5.0.3. Upgrade your dependency to 4.1.2, 5.0.3 or later.
What is the CVSS score of CVE-2022-24759?
CVE-2022-24759 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H.
What CWE is associated with CVE-2022-24759?
CVE-2022-24759 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-24759?
Run the dependency tree command: 'npm ls @chainsafe/libp2p-noise'. 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-j3ff-xp6c-6gcc",
  "modified" : "2022-03-18T18:57:53Z",
  "published" : "2022-03-18T18:57:53Z",
  "aliases" : [ "CVE-2022-24759" ],
  "summary" : "Failure to validate signature during handshake",
  "details" : "### Impact\n`@chainsafe/libp2p-noise` before 4.1.2 and 5.0.3 was not correctly validating signatures during the handshake process.\nThis may allow a man-in-the-middle to pose as other peers and get those peers banned.\n\n### Patches\nUsers should upgrade to 4.1.2 or 5.0.3\n\n### Workarounds\nNo workarounds, just patch upgrade\n\n### References\nhttps://github.com/ChainSafe/js-libp2p-noise/pull/130\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@chainsafe/libp2p-noise"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@chainsafe/libp2p-noise"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ChainSafe/js-libp2p-noise/security/advisories/GHSA-j3ff-xp6c-6gcc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24759"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ChainSafe/js-libp2p-noise/pull/130"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ChainSafe"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ChainSafe/js-libp2p-noise/releases/tag/v5.0.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-347" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-18T18:57:53Z",
    "nvd_published_at" : "2022-03-17T17:15:00Z"
  }
}