Skip to content

Unchained Engine v4.8.34

Choose a tag to compare

@pozylon pozylon released this 19 Nov 17:09
· 583 commits to master since this release
612e759

Security release of the v4.8 line, published on npm under the release-4.8 tag. Rolls up every v4.8 change since the last published release, v4.8.24. The PayPal and privileged-user fixes (GHSA-pf69-hxqg-8q5j, GHSA-pprf-rq6p-4h6h) are in v4.9.2 only.

Unchained Engine v4.8

Security

  • Breaking: the session cookie now defaults to SameSite=Lax instead of None, and the GraphQL endpoint no longer answers cross-origin requests with Access-Control-Allow-Credentials (@unchainedshop/api): the previous defaults let any website read and mutate the API as the logged-in user. Set UNCHAINED_COOKIE_SAMESITE=none and pass your own cors option to startPlatform to restore the old behaviour for a storefront on another origin. See MIGRATION.md. (GHSA-774c-x9hf-j87f)
  • Breaking: /graphql rejects application/x-www-form-urlencoded, multipart/form-data and text/plain with 415, and /bulk-import and /temp-upload reject browser requests carrying Sec-Fetch-Site: cross-site with 403 (@unchainedshop/api): these are the request shapes a cross-site HTML form can send without a preflight. Server-to-server clients send no fetch metadata and are unaffected. (GHSA-774c-x9hf-j87f)
  • The Payrexx webhook verifies which order payment it may act on (@unchainedshop/plugins): it checked out whatever transaction.referenceId named, so an unauthenticated POST could confirm an arbitrary order — including one whose payment provider is not Payrexx and whose adapter allows pay-later — and a non-string referenceId reached the id filter as a MongoDB operator. (GHSA-2qrc-w7mc-j6cr)
  • The Apple IAP webhook fails closed without a shared secret (@unchainedshop/plugins): with APPLE_IAP_SHARED_SECRET unset, password !== APPLE_IAP_SHARED_SECRET compared undefined with undefined and let anonymous callers reach order checkout and enrollment termination. The secret is now required and compared in constant time. (GHSA-g889-345v-v6j5)
  • Signed GridFS upload URLs expire and cannot be replayed (@unchainedshop/plugins): the PUT branch never compared the signed expiry against the clock, and its "already linked" guard tested expires === null while linkFile unsets the field, so a used upload URL stayed a permanent write capability on that file. (GHSA-4m6j-2f8h-6p9c)
  • Uploaded files are no longer served inline on the engine origin (@unchainedshop/plugins): downloads echoed the uploader's Content-Type with no disposition, so an HTML or SVG upload executed as script next to the GraphQL endpoint and the session cookie. Responses now carry nosniff and a sandbox CSP, and only known-safe image, audio and video types are served inline. (GHSA-4m6j-2f8h-6p9c)
  • Token ownership requires a subject (@unchainedshop/api): exporting a token to a wallet removes its userId, so token.userId === userId compared undefined with undefined and granted anonymous callers viewToken and updateToken on every exported token — reading it and its accessKey, and invalidating it. (GHSA-5rrj-3q6r-796m)
  • verifyEmail no longer hands a foreign session to the token owner (@unchainedshop/api): it migrated the caller's cart and bookmarks into the account the token belongs to and logged that browser in as the token owner, so luring a signed-in customer onto a verification link moved their cart, billing address and contact to the attacker. Guest sessions keep being migrated. (GHSA-6cfp-2g2j-6jv3)
  • Checkout takes its lock before reading the order (@unchainedshop/core): concurrent checkoutCart calls for one cart all passed the status check before any held the lock and then each processed the same order from a stale snapshot, so one charge produced several enrollments and several tokens sharing one serial number. (GHSA-c7j6-77hq-jg8r)
  • Cart mutations and checkout now exclude each other (@unchainedshop/api, @unchainedshop/core, @unchainedshop/core-orders): cart mutations and the login cart merge now take the checkout lock and answer OrderLockedError while it is held, so a position added during the payment call is no longer confirmed on an order whose charged total predates it. (GHSA-c7j6-77hq-jg8r)
  • Breaking: the deprecated setOrderPaymentProvider, setOrderDeliveryProvider, updateOrderDeliveryShipping, updateOrderDeliveryPickUp, updateOrderPaymentGeneric and updateOrderPaymentInvoice mutations are removed (@unchainedshop/api): they were an unlocked route into a cart being charged; use updateCart, updateCartDelivery* and updateCartPayment*.
  • The login cart merge awaits its own writes (@unchainedshop/core): merged positions could land in the target cart after its recalculation had already run.
  • Payment adapters only accept a payment that belongs to the order (@unchainedshop/plugins): Cryptopay settled a fiat order for an underpaid or unpriced crypto transfer, Datatrans and Saferpay accepted a transaction issued for another order payment (Datatrans transactions must now carry the refno from signPaymentProviderForCheckout), and Apple IAP trusted receipt info sent with the checkout. (GHSA-6rxv-f6h5-vhp7)
  • The Fastify adapter rotates the session id on login and logout (@unchainedshop/api): it assigned the user to whichever session the request already carried, so a session planted before the login kept working afterwards. Express rotated already, through passport. (GHSA-gqwv-8jc2-f4pc)
  • signPaymentProviderForCheckout requires the updateOrderPayment action (@unchainedshop/api, 4.8.16): it signed any order payment id it was given, so a logged-in user could open a payment session on another user's order (GHSA-qrw7-mrg7-4pr8).

Patch

  • Breaking: Node 24.22.1 is the minimum supported runtime — the checkout lock uses await using, which Node 22 cannot parse.
  • Breaking: ordersSettings.lockOrderDuringCheckout is removed (@unchainedshop/core-orders) — nothing read it and checkout locking is unconditional.
  • updateCart rejects an empty-string orderId, paymentProviderId or deliveryProviderId with InvalidIdError (@unchainedshop/api).
  • OrderItemNotFoundError and OrderDiscountNotFoundError carry itemId / discountId in extensions (@unchainedshop/api).
  • Order locks are renewed while held (@unchainedshop/core-orders): callers of modules.orders.acquireLock must release every lock, and code running inside a cart mutation must not acquire order:checkout:<orderId>.
  • Fastify apps start with @fastify/session 11.1.6 (@unchainedshop/api): the session store now implements the conditional compareAndSet write that 11.1.6 (GHSA-2hw7-jxfh-4rm3) requires of custom stores; before, the Fastify adapter failed at startup with "the store must implement compareAndSet".
  • nodemailer 10 is accepted (@unchainedshop/plugins): the optional peer range now allows nodemailer 10, so projects can install 10.0.9 or later, which fixes the addressparser advisories still open in 9.x (CVE-2026-90776, GHSA-v53p-9fqp-m79j, GHSA-g57g-f23g-4646).
  • Audit users always name someone (@unchainedshop/events): OCSF users without a login are anonymous (type Unknown) for requests and the engine (type System) otherwise, instead of an empty object, which OCSF rejects.
  • Validation errors are reported once (@unchainedshop/api): the graphql-js engine swap also handed graphql's validation rules to useEngine, which appends them to the rules yoga already registers, so every operation was validated twice and every validation error came back twice.
  • Product variations keep their order (@unchainedshop/core-products, @unchainedshop/core): variations had no order field, the bulk importer upserted them in parallel and findProductVariations did not sort, so ConfigurableProduct.variations returned the axes in whatever order the concurrent inserts landed, and a re-import in a new order changed nothing. Variations now carry a sortKey: the bulk importer upserts them one after another and sets it from their position in the payload (a reorder in a later import is applied), modules.products.variations.create appends after the product's last variation when no sortKey is given (like product media), and findProductVariations sorts by it. The product_variations index on productId becomes { productId, sortKey }. Existing variations without sortKey sort first, in their previous order, until the next import.
  • SimpleProduct.simulatedDispatches and simulatedStocks return every provider pair once and honour deliveryProviderType (@unchainedshop/core, @unchainedshop/api): the services appended the accumulated result to itself for every delivery provider, so n delivery providers produced 2ⁿ−1 rows, and the resolvers never passed deliveryProviderType on. The result now has one row per delivery and warehousing provider pair, restricted to the requested delivery provider type: SHIPPING by default, as the schema declares, or every type with an explicit deliveryProviderType: null. Clients that relied on the default also returning pickup providers need to pass PICKUP or null. TokenizedProduct.simulatedStocks, which has no type argument, keeps covering every delivery provider.
  • Order mails show the shipping address as delivery address (@unchainedshop/platform): the default order confirmation, order rejection and delivery forwarding templates read the delivery address from context.deliveryAddress, a key nothing writes (updateCartDeliveryShipping stores context.address), so they always printed the billing address. That includes the DELIVERY mail with which shop.unchained.delivery.send-message forwards shipping orders to the fulfilment address. getOrderSummaryData now reads context.address and keeps context.deliveryAddress as a fallback.
  • A provider whose plugin is not registered no longer breaks every cart (@unchainedshop/core): the supported-provider lookups asked the delivery, payment and warehousing directors about every provider, and they throw when no adapter is registered for a provider's adapterKey. A single stale provider (plugin removed or renamed, or provider created before its plugin was deployed) made createCart, addCartProduct and every other cart recalculation fail with Unexpected error., and broke Order.supportedDeliveryProviders and Order.supportedPaymentProviders. Such providers now count as inactive and are logged with a warning; operations that address that one provider still fail with the adapter error.
  • Subscriptions no longer multiply with every generated order (@unchainedshop/core-orders): modules.orders.create dropped originEnrollmentId, so the orders that the ENROLLMENT_ORDER_GENERATOR worker places for an enrollment lost the link to it, and checking them out created a further enrollment for the plan product. Every billing period doubled the customer's active enrollments and with them the generated orders. Generated orders now keep originEnrollmentId. Enrollments created by this bug are not removed automatically: their orderIdForFirstPeriod is an order that is also listed in the periods of another enrollment.
  • Filtered product searches keep their order again (@unchainedshop/core): once the searched products outnumbered the products of a selected filter option, productFacetedSearch returned them in the filter's order. Text search combined with a filter (e.g. a brand) lost its relevance order, assortment listings lost their sortKey order, and several values of one filter came back grouped by value. Regression since v3.0, where the native Set.prototype.intersection (which iterates the smaller set) replaced an order-preserving helper.
  • User role changes and deletion now prevent removing the sole active administrator. GraphQL reports a typed LastAdminError, and Admin UI explains that another active user must be promoted before the sole administrator can be removed or demoted.