CVE-2026-145562
Deferred Deferred - Pending Action

Bagisto Insecure Randomness in Coupon Code Generation

Vulnerability report for CVE-2026-145562, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-12-05

Last updated on: 2026-12-05

Assigner: VulnCheck

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-12-05
Last Modified
2026-12-05
Generated
2026-12-06
AI Q&A
2026-12-05
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
Webkul Bagisto From 0 (inc) to 2.5.2 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-338 The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

Bagisto through version 2.5.2 has an insecure randomness vulnerability in coupon code generation. The CartRuleCouponRepository uses PHP's rand() function, which is cryptographically weak. Attackers can predict bulk coupon codes by recovering the 32-bit Mersenne Twister seed if they obtain two or more codes from the same batch.

Detection Guidance

Check Bagisto version for 2.5.2 or earlier. Review coupon generation logs for predictable patterns. Inspect CartRuleCouponRepository.php for rand() usage in getRandomString().

Commands: grep -r "rand()" /path/to/bagisto/packages/Webkul/CartRule/src/Repositories/CartRuleCouponRepository.php

Impact Analysis

Attackers can compute unissued coupon codes and redeem unauthorized discounts meant for others. This could lead to financial losses for businesses using Bagisto by allowing fraudulent coupon redemptions.

Compliance Impact

This vulnerability does not directly impact GDPR or HIPAA compliance as it involves coupon code prediction in an e-commerce system rather than data privacy or security controls. However, if coupon misuse leads to unauthorized discounts or financial transactions, it could indirectly affect financial record-keeping requirements under these regulations.

Mitigation Strategies

Upgrade Bagisto to a version beyond 2.5.2. Replace rand() with cryptographically secure random functions like random_int() or openssl_random_pseudo_bytes().

Regenerate all existing coupon codes to invalidate potentially compromised ones.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-145562. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...