{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "0"
                  },
                  {
                    "last_affected": "2.5.2"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              }
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "03114b667914054d48f0dd27698db04da5e07a13"
            }
          ],
          "repo": "https://github.com/bagisto/bagisto",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "VulnCheck",
    "cwe_ids": [
      "CWE-338"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/145xxx/CVE-2026-145562.json"
  },
  "details": "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.",
  "id": "CVE-2026-145562",
  "modified": "2026-12-05T15:46:08.880752210Z",
  "published": "2026-12-05T14:04:53.898Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/145xxx/CVE-2026-145562.json"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/bagisto/bagisto"
    },
    {
      "type": "ARTICLE",
      "url": "https://github.com/bagisto/bagisto/blob/v2.5.2/packages/Webkul/CartRule/src/Repositories/CartRuleCouponRepository.php#L33-L60"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-145562"
    },
    {
      "type": "ADVISORY",
      "url": "https://www.vulncheck.com/advisories/bagisto-through-2.5.2-predictable-coupon-codes-via-cartrulecouponrepository"
    }
  ],
  "schema_version": "1.9.2",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Bagisto through 2.5.2 Predictable Coupon Codes via CartRuleCouponRepository"
}