GHSA-wm63-7627-ch33: @vendure/core @vendure/core's Insecure CurrencyCode Handling Allows Vulnerability
MODERATEGHSA-wm63-7627-ch33 is a MODERATE (CVSS 5.3) @vendure/core's insecure currencycode handling allows vulnerability (General Security Weakness) affecting @vendure/core libraries in the npm ecosystem. The issue involves @vendure/core's insecure currencycode handling allows wrong payment amounts. Remediation is available by upgrading affected packages to version 2.1.3.
GHSA-wm63-7627-ch33 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 GHSA-wm63-7627-ch33
To remediate this vulnerability, upgrade all affected @vendure/core 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 @vendure/core@2.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @vendure/core
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-wm63-7627-ch33, inspect your project dependencies using npm:
npm ls @vendure/core
Analyze the terminal output to locate any version of @vendure/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.3), your application is affected.
Note: The npm ls @vendure/core 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 @vendure/core, 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
GHSA-wm63-7627-ch33 Affected @vendure/core Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@vendure/core
|
npm |
< 2.1.3
|
2.1.3
|
References
Frequently Asked Questions
What is GHSA-wm63-7627-ch33?
Which @vendure/core versions are affected?
What version fixes GHSA-wm63-7627-ch33?
Is @vendure/core affected?
What is the CVSS score of GHSA-wm63-7627-ch33?
What CWE is associated with GHSA-wm63-7627-ch33?
How can I check npm dependencies for GHSA-wm63-7627-ch33?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wm63-7627-ch33",
"modified" : "2023-11-17T21:50:31Z",
"published" : "2023-11-17T21:50:31Z",
"aliases" : [ ],
"summary" : "@vendure/core's insecure currencyCode handling allows wrong payment amounts",
"details" : "### Impact\n\nCurrently, in many Vendure deployments it's possible to select any currencyCode (really any, doesn't need to be assigned to the channel) and pay through Mollie and Stripe in that particular currencyCode.\nThe prices are not transformed. The result is the Order is in Payment Settled in the foreign currency.\nSee SS, CZK is not in the channel.\nI've tested with Mollie and Stripe it both works.\n\n**Further notes**\n\nAfter looking into this further and with help from the comments below, the root cause of this vulnerability is the ability to specify an arbitrary `currencyCode` as a query parameter to an API call, and then Vendure will use this and pass it to the rest of the system as `RequestContext.currencyCode`.\n\nThe solution is to add validation to the passed `currencyCode` to ensure that it matches one of the available `availableCurrencyCodes` of the active Channel.\n\nFurthermore, an additional check has been added for when the currencyCode changes during the AddingItems stage - in this case we need to re-calculate the prices in the new currency.\n\n### Patches\nv2.1.3\n\n### Workarounds\nYou can define a custom OrderProcess [onTransitionStart function](https://docs.vendure.io/guides/core-concepts/orders/#intercepting-a-state-transition) which can verify the order's `currencyCode` is as expected before allowing the transition to the `ArrangingPayment` state.",
"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" : "@vendure/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/vendure-ecommerce/vendure/security/advisories/GHSA-wm63-7627-ch33"
}, {
"type" : "WEB",
"url" : "https://github.com/vendure-ecommerce/vendure/commit/5e506fd8ba9f7e20030c329e62af1140d906121f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/vendure-ecommerce/vendure"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-11-17T21:50:31Z",
"nvd_published_at" : null
}
}