Vulnerabilities in pkg:npm/@solana/pay
PACKAGECVE-2022-35917 is a MODERATE (CVSS 5.3) solana pay vulnerable to weakness vulnerability (CWE-670: Always-Incorrect Control Flow Implementation) affecting @solana/pay libraries in the npm ecosystem. The issue involves solana pay vulnerable to weakness in transfer validation logic. Remediation is available by upgrading affected packages to version 0.2.1.
pkg:npm/@solana/pay
Vulnerability advisories affecting package pkg:npm/@solana/pay. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-j47c-j42c-mwqq | CVE-2022-35917 | MODERATE | Solana Pay Vulnerable to Weakness in Transfer Validation Logic |
CVE-2022-35917 at a Glance
Security Impact
CVSS: 5.3
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:L/A:N).
How to Fix CVE-2022-35917
To remediate this vulnerability, upgrade all affected @solana/pay dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @solana/pay@0.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @solana/pay
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-35917, inspect your project dependencies using npm:
npm ls @solana/pay
Analyze the terminal output to locate any version of @solana/pay in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.1), your application is affected.
Note: The npm ls @solana/pay 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-670: Always-Incorrect Control Flow Implementation, where the code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated. In @solana/pay, 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
CVE-2022-35917 Affected @solana/pay Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@solana/pay
|
npm |
< 0.2.1
|
0.2.1
|
References
Frequently Asked Questions
What is CVE-2022-35917?
Which @solana/pay versions are affected?
What version fixes CVE-2022-35917?
Is @solana/pay affected?
What is the CVSS score of CVE-2022-35917?
What CWE is associated with CVE-2022-35917?
How can I check npm dependencies for CVE-2022-35917?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j47c-j42c-mwqq",
"modified" : "2022-08-06T05:39:18Z",
"published" : "2022-08-06T05:39:18Z",
"aliases" : [ "CVE-2022-35917" ],
"summary" : "Solana Pay Vulnerable to Weakness in Transfer Validation Logic",
"details" : "### Description\nWhen a Solana Pay transaction is located using a [reference key](https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#reference), it may be checked to represent a transfer of the desired amount to the recipient, using the supplied [`validateTransfer` function](https://github.com/solana-labs/solana-pay/blob/master/core/src/validateTransfer.ts). An edge case regarding this mechanism could cause the validation logic to validate multiple transfers.\n\n### Impact\nMost known Solana Pay point of sale applications are currently run on physical point of sale devices, which makes this issue unlikely to occur. However, there may be web-based point of sale applications using the protocol where it may be more likely to occur.\n\n### Patches\nThis issue has been patched as of version [`0.2.1`](https://www.npmjs.com/package/@solana/pay/v/0.2.1). Users of the Solana Pay SDK should upgrade to it.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@solana/pay"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.2.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.2.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/solana-labs/solana-pay/security/advisories/GHSA-j47c-j42c-mwqq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-35917"
}, {
"type" : "WEB",
"url" : "https://github.com/solana-labs/solana-pay/commit/ac6ce0d0a81137700874a8bf5a7caac3be999fad"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/solana-labs/solana-pay"
}, {
"type" : "WEB",
"url" : "https://github.com/solana-labs/solana-pay/blob/master/SPEC.md#reference"
}, {
"type" : "WEB",
"url" : "https://github.com/solana-labs/solana-pay/blob/master/core/src/validateTransfer.ts"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-670" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-08-06T05:39:18Z",
"nvd_published_at" : "2022-08-01T22:15:00Z"
}
}