GHSA-xfrc-7mj2-5xh9: Zencashjs Undefined Behavior Vulnerability

CRITICAL
Published
Advisory Summary

GHSA-xfrc-7mj2-5xh9 is a CRITICAL undefined behavior vulnerability (General Security Weakness) affecting Zencashjs libraries in the npm ecosystem. The issue involves undefined behavior in zencashjs. Remediation is available by upgrading affected packages to version 1.2.0.

GHSA-xfrc-7mj2-5xh9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-xfrc-7mj2-5xh9
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Zencashjs
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-xfrc-7mj2-5xh9

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

zencashjs fixed: 1.2.0
npm install zencashjs@1.2.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 zencashjs

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-xfrc-7mj2-5xh9, inspect your project dependencies using npm:

npm ls zencashjs

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

Note: The npm ls zencashjs 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 General Security Weakness. In Zencashjs, 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

Versions of `zencashjs` prior to 1.2.0 may cause loss of funds when used with cryptocurrency wallets. The package relies on a string comparison of the first two characters of a Horizen address to determine the destination address type of a transaction (P2PKH or P2SH). Due to the base58 address prefixes chosen in Horizen there exists the possibility of a clash of address prefixes for testnet P2PKH and mainnet P2SH addresses, testnet P2PKH addresses start with “zt” while a subset of mainnet P2SH addresses can also start with “zt”. The package interprets transactions sent to a “zt” P2SH address on mainnet as P2PKH transactions erroneously. Any funds sent to a mainnet P2SH multisignature address starting with “zt” will be sent to the wrong address and be lost. ## Recommendation Upgrade to version 1.2.0 or later.

GHSA-xfrc-7mj2-5xh9 Affected Zencashjs Versions

1 component(s)
Fixed Versions:
1.2.0
Product / Package Ecosystem Affected Versions Fixed Version
zencashjs
npm
< 1.2.0
1.2.0

References

Frequently Asked Questions

What is GHSA-xfrc-7mj2-5xh9?
GHSA-xfrc-7mj2-5xh9 is a security vulnerability in Zencashjs involving Undefined Behavior in zencashjs under General Security Weakness.
Which Zencashjs versions are affected?
Affected versions include releases prior to 1.2.0 across affected packages: zencashjs.
What version fixes GHSA-xfrc-7mj2-5xh9?
Upgrading to 1.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is zencashjs affected?
Yes, zencashjs is affected in releases prior to 1.2.0. Upgrade your dependency to 1.2.0 or later.
What CWE is associated with GHSA-xfrc-7mj2-5xh9?
GHSA-xfrc-7mj2-5xh9 is classified under General Security Weakness.
How can I check npm dependencies for GHSA-xfrc-7mj2-5xh9?
Run the dependency tree command: 'npm ls zencashjs'. 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-xfrc-7mj2-5xh9",
  "modified" : "2020-08-31T18:44:53Z",
  "published" : "2020-09-03T17:14:51Z",
  "aliases" : [ ],
  "summary" : "Undefined Behavior in zencashjs",
  "details" : "Versions of `zencashjs` prior to 1.2.0 may cause loss of funds when used with cryptocurrency wallets. The package relies on a string comparison of the first two characters of a Horizen address to determine the destination address type of a transaction (P2PKH or P2SH). Due to the base58 address prefixes chosen in Horizen there exists the possibility of a clash of address prefixes for testnet P2PKH and mainnet P2SH addresses, testnet P2PKH addresses start with “zt” while a subset of mainnet P2SH addresses can also start with “zt”. The package interprets transactions sent to a “zt” P2SH address on mainnet as P2PKH transactions erroneously. Any funds sent to a mainnet P2SH multisignature address starting with “zt” will be sent to the wrong address and be lost.\n\n\n## Recommendation\n\nUpgrade to version 1.2.0 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "zencashjs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ZencashOfficial/zencashjs/commit/db01bd94b9f8a956d7835e934500eaa643f8bd13#diff-42d8d2088a96641b563b25ad908b0c0fR146"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1035"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:44:53Z",
    "nvd_published_at" : null
  }
}