CVE-2026-145562: Bagisto through 2.5.2 Predictable Coupon Codes via CartRuleCouponRepository
Bagisto through 2.5.2 contains an insecure randomness vulnerability that allows customers to predict bulk coupon codes generated by CartRuleCouponRepository::getRandomString() using PHP rand(). Attackers holding two or more codes from one batch can recover the 32-bit Mersenne Twister seed and compute unissued codes to redeem discounts meant for others.
Affected Software
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Bagisto deployments through 2.5.2 that generate bulk coupon codes are exposed. A customer or other low-privileged user who can obtain codes from the same generated batch may be able to predict additional codes.
What does an attacker need to exploit it?
The attacker needs two or more coupon codes from a single batch. They can use those codes to recover the 32-bit Mersenne Twister seed used by PHP rand() and calculate unissued codes from that batch.
What is the impact of successfully predicting coupon codes?
An attacker can redeem discounts associated with unissued coupon codes that were intended for other recipients. The stated impact is limited to integrity; no confidentiality or availability impact is identified.