spree_core is vulnerable to Race Condition (TOCTOU)
54
CVE Score
Medium
Race Condition (TOCTOU)
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.
Upgrade the spree_core or spree library to the patch version.
You are affected if you are using a version that falls within the vulnerable range.
5.0.0 - 5.3.4
Fixed in 5.3.5spree_core is vulnerable to Race Condition (TOCTOU) in versions 5.0.0 - 5.3.4.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.