Intel

AIKIDO-2026-10390

spree_core is vulnerable to Race Condition (TOCTOU)

Race Condition (TOCTOU) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.

54

Medium Risk

This Affects:

RUBYspree_core
5.0.0 - 5.3.4
Fixed in 5.3.5

TL;DR

The gift card apply service computes the redeemable amount from gift_card.amount_remaining and order.total then creates store credits without holding a lock that covers both the gift card and the order. Under concurrent requests (e.g. the same gift card applied to multiple orders at once), the check and the credit creation can interleave so that the total store credits created exceed the gift card value, allowing overspend. The fix wraps the read and the store credit creation in order.with_lock and acquires gift_card.lock! inside it so the critical section is serialized.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

spree_core is vulnerable to Race Condition (TOCTOU) in versions 5.0.0 - 5.3.4.

How to fix this

Upgrade the spree_core or spree library to the patch version.