Repository navigation
Unchained Engine v4.8.34
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=Laxinstead ofNone, and the GraphQL endpoint no longer answers cross-origin requests withAccess-Control-Allow-Credentials(@unchainedshop/api): the previous defaults let any website read and mutate the API as the logged-in user. SetUNCHAINED_COOKIE_SAMESITE=noneand pass your owncorsoption tostartPlatformto restore the old behaviour for a storefront on another origin. SeeMIGRATION.md. (GHSA-774c-x9hf-j87f) - Breaking:
/graphqlrejectsapplication/x-www-form-urlencoded,multipart/form-dataandtext/plainwith 415, and/bulk-importand/temp-uploadreject browser requests carryingSec-Fetch-Site: cross-sitewith 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 whatevertransaction.referenceIdnamed, 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-stringreferenceIdreached the id filter as a MongoDB operator. (GHSA-2qrc-w7mc-j6cr) - The Apple IAP webhook fails closed without a shared secret (
@unchainedshop/plugins): withAPPLE_IAP_SHARED_SECRETunset,password !== APPLE_IAP_SHARED_SECRETcomparedundefinedwithundefinedand 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 testedexpires === nullwhilelinkFileunsets 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'sContent-Typewith no disposition, so an HTML or SVG upload executed as script next to the GraphQL endpoint and the session cookie. Responses now carrynosniffand 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 itsuserId, sotoken.userId === userIdcomparedundefinedwithundefinedand granted anonymous callersviewTokenandupdateTokenon every exported token — reading it and itsaccessKey, and invalidating it. (GHSA-5rrj-3q6r-796m) verifyEmailno 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): concurrentcheckoutCartcalls 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 answerOrderLockedErrorwhile 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,updateOrderPaymentGenericandupdateOrderPaymentInvoicemutations are removed (@unchainedshop/api): they were an unlocked route into a cart being charged; useupdateCart,updateCartDelivery*andupdateCartPayment*. - 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 therefnofromsignPaymentProviderForCheckout), 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) signPaymentProviderForCheckoutrequires theupdateOrderPaymentaction (@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.lockOrderDuringCheckoutis removed (@unchainedshop/core-orders) — nothing read it and checkout locking is unconditional. updateCartrejects an empty-stringorderId,paymentProviderIdordeliveryProviderIdwithInvalidIdError(@unchainedshop/api).OrderItemNotFoundErrorandOrderDiscountNotFoundErrorcarryitemId/discountIdinextensions(@unchainedshop/api).- Order locks are renewed while held (
@unchainedshop/core-orders): callers ofmodules.orders.acquireLockmust release every lock, and code running inside a cart mutation must not acquireorder:checkout:<orderId>. - Fastify apps start with
@fastify/session11.1.6 (@unchainedshop/api): the session store now implements the conditionalcompareAndSetwrite 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 allowsnodemailer10, 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 areanonymous(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 touseEngine, 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 andfindProductVariationsdid not sort, soConfigurableProduct.variationsreturned the axes in whatever order the concurrent inserts landed, and a re-import in a new order changed nothing. Variations now carry asortKey: 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.createappends after the product's last variation when nosortKeyis given (like product media), andfindProductVariationssorts by it. Theproduct_variationsindex onproductIdbecomes{ productId, sortKey }. Existing variations withoutsortKeysort first, in their previous order, until the next import. SimpleProduct.simulatedDispatchesandsimulatedStocksreturn every provider pair once and honourdeliveryProviderType(@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 passeddeliveryProviderTypeon. The result now has one row per delivery and warehousing provider pair, restricted to the requested delivery provider type:SHIPPINGby default, as the schema declares, or every type with an explicitdeliveryProviderType: null. Clients that relied on the default also returning pickup providers need to passPICKUPornull.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 fromcontext.deliveryAddress, a key nothing writes (updateCartDeliveryShippingstorescontext.address), so they always printed the billing address. That includes theDELIVERYmail with whichshop.unchained.delivery.send-messageforwards shipping orders to the fulfilment address.getOrderSummaryDatanow readscontext.addressand keepscontext.deliveryAddressas 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'sadapterKey. A single stale provider (plugin removed or renamed, or provider created before its plugin was deployed) madecreateCart,addCartProductand every other cart recalculation fail withUnexpected error., and brokeOrder.supportedDeliveryProvidersandOrder.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.createdroppedoriginEnrollmentId, so the orders that theENROLLMENT_ORDER_GENERATORworker 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 keeporiginEnrollmentId. Enrollments created by this bug are not removed automatically: theirorderIdForFirstPeriodis an order that is also listed in theperiodsof another enrollment. - Filtered product searches keep their order again (
@unchainedshop/core): once the searched products outnumbered the products of a selected filter option,productFacetedSearchreturned them in the filter's order. Text search combined with a filter (e.g. a brand) lost its relevance order, assortment listings lost theirsortKeyorder, and several values of one filter came back grouped by value. Regression since v3.0, where the nativeSet.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.