Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS13bTYzLTc2MjctY2gzM84AA3P1

@vendure/core's insecure currencyCode handling allows wrong payment amounts

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 which can verify the order's currencyCode is as expected before allowing the transition to the ArrangingPayment state.

Permalink: https://github.com/advisories/GHSA-wm63-7627-ch33
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS13bTYzLTc2MjctY2gzM84AA3P1
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 1 year ago
Updated: about 1 year ago


CVSS Score: 5.3
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Identifiers: GHSA-wm63-7627-ch33
References: Repository: https://github.com/vendure-ecommerce/vendure
Blast Radius: 9.8

Affected Packages

npm:@vendure/core
Dependent packages: 160
Dependent repositories: 72
Downloads: 33,511 last month
Affected Version Ranges: < 2.1.3
Fixed in: 2.1.3
All affected versions: 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.3.3, 0.3.4, 0.4.0, 0.5.0, 0.5.1, 0.6.0, 0.6.1, 0.6.2, 0.6.4, 0.6.5, 0.7.0, 0.8.0, 0.8.1, 0.8.2, 0.9.0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