GHSA-wm63-7627-ch33: @vendure/core @vendure/core's Insecure CurrencyCode Handling Allows Vulnerability

MODERATE
CVSS 5.3
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-wm63-7627-ch33
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification General Security Weakness
Affected Product @vendure/core
Package Ecosystem npm
Published Date
Last Updated

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).

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 Low (I:L)
Availability None (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.

@vendure/core fixed: 2.1.3
npm install @vendure/core@2.1.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 @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

### Impact Currently, 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. The prices are not transformed. The result is the Order is in Payment Settled in the foreign currency. See SS, CZK is not in the channel. I've tested with Mollie and Stripe it both works. **Further notes** After 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`. The solution is to add validation to the passed `currencyCode` to ensure that it matches one of the available `availableCurrencyCodes` of the active Channel. Furthermore, 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. ### Patches v2.1.3 ### Workarounds You 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.

GHSA-wm63-7627-ch33 Affected @vendure/core Versions

1 component(s)
Fixed Versions:
2.1.3
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?
GHSA-wm63-7627-ch33 is a security vulnerability in @vendure/core involving @vendure/core's insecure currencyCode handling allows wrong payment amounts under General Security Weakness.
Which @vendure/core versions are affected?
Affected versions include releases prior to 2.1.3 across affected packages: @vendure/core.
What version fixes GHSA-wm63-7627-ch33?
Upgrading to 2.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @vendure/core affected?
Yes, @vendure/core is affected in releases prior to 2.1.3. Upgrade your dependency to 2.1.3 or later.
What is the CVSS score of GHSA-wm63-7627-ch33?
GHSA-wm63-7627-ch33 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-wm63-7627-ch33?
GHSA-wm63-7627-ch33 is classified under General Security Weakness.
How can I check npm dependencies for GHSA-wm63-7627-ch33?
Run the dependency tree command: 'npm ls @vendure/core'. 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-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
  }
}