CVE-2026-56831: Shopper Negative Discount Values Accepted And Vulnerability

MODERATE
Advisory Identifier: GHSA-5vf4-452p-jjhf
CVSS 6.5
CWE-20
Published
Advisory Summary

CVE-2026-56831 is a MODERATE (CVSS 6.5) negative discount values accepted and vulnerability (CWE-20: Improper Input Validation) affecting Shopper libraries in the Packagist ecosystem. The issue involves negative discount values accepted and propagated through order calculation pipeline. Remediation is available by upgrading affected packages to version 2.9.0.

CVE-2026-56831 at a Glance

CVE Identifier CVE-2026-56831
GHSA Identifier GHSA-5vf4-452p-jjhf
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Shopper
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-56831

To remediate this vulnerability, upgrade all affected Shopper dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

shopper/framework fixed: 2.9.0
Upgrade shopper/framework to 2.9.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for shopper/framework

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-56831, inspect your project dependencies for Shopper:

inspect dependencies for shopper/framework

Analyze the terminal output to locate any version of Shopper in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.9.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Shopper, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The Shopper Framework discount management functionality accepts negative discount values without server-side validation. It was confirmed that negative fixed-amount discounts can be created through the administrative interface, persisted to the database, and subsequently processed by the cart/order calculation pipeline. The application appears to assume that discount values are always positive but does not enforce this assumption during creation, storage, or calculation. As a result, malformed discount records can influence financial calculations and produce unintended order totals. --- ## Affected Product **Package:** shopper/framework **Version Tested:** 2.8.1 --- ## Vulnerability Type * Business Logic Vulnerability * Improper Input Validation (CWE-20) --- ## Description While reviewing the discount functionality, it was discovered that the application accepts negative discount values through the administrative interface. Example values tested: ```text -50.00 -99,999,999.00 ``` The application accepted these values without validation and stored them in the database. Example records observed in the `sh_discounts` table: ```text 1 | QCZ5Y3HESM | fixed_amount | -5000 4 | TOZKAHCB4S | fixed_amount | -9999999900 ``` This demonstrates that negative discount values are successfully persisted. --- ## Steps to Reproduce ### 1. Create a Discount Login as an administrator. Navigate to: ```text /cpanel/discounts ``` Create a new discount with the following values: ```text Type: fixed_amount Value: -99999999 ``` Save the discount. ### 2. Observe Successful Creation The discount is accepted by the application and displayed in the administration interface. Example: ```text Code: TOZKAHCB4S Amount: -$99,999,999.00 ``` ### 3. Verify Database Persistence Inspect the database: ```sql select * from sh_discounts; ``` Observed entry: ```text TOZKAHCB4S | fixed_amount | -9999999900 ``` --- ## Technical Analysis ### Discount Calculation File: ```text vendor/shopper/cart/src/Discounts/DiscountCalculator.php ``` Observed code: ```php $fixedAmount = $discount->value; ``` The value is later processed without validation: ```php $fixedAmount = min($fixedAmount, $applicableSubtotal); ``` When a negative value is supplied: ```php min(-9999999900, 10000) ``` returns: ```php -9999999900 ``` allowing the negative value to continue through the calculation pipeline. The resulting adjustment values are inserted into the database: ```php CartLineAdjustment::query()->insert($adjustments); ``` No validation was identified to ensure that discount amounts are positive before calculations occur. --- ### Final Total Calculation File: ```text vendor/shopper/cart/src/Pipelines/Calculate.php ``` Observed logic: ```php $context->total = max( 0, $context->taxInclusive ? $context->subtotal - $context->discountTotal : $context->subtotal - $context->discountTotal + $context->taxTotal ); ``` Because negative discount values are allowed to reach this stage, financial calculations are performed using malformed discount data. Example: ```text Subtotal = 10000 DiscountTotal = -5000 ``` Resulting calculation: ```text 10000 - (-5000) ``` Result: ```text 15000 ``` This demonstrates that negative discount values directly affect order total calculations. --- ## Impact The following was confirmed: * Negative discount values are accepted. * Negative discount values are persisted. * Negative discount values are processed by the discount calculation engine. * Negative discount values affect order total calculations. Potential consequences include: * Incorrect pricing calculations. * Financial data integrity issues. * Unexpected order totals. * Violated assumptions within downstream pricing logic. * Future vulnerabilities if additional components assume discount values are always positive. Because Shopper is a headless e-commerce administration framework and does not ship with a customer-facing storefront, it was not verified a customer-facing exploitation path. However, malformed discount records currently propagate through pricing calculations without validation. --- ## Recommendation Implement server-side validation enforcing positive discount values before persistence and before entering the calculation pipeline. Suggested validation: ### Fixed Amount Discounts ```text value > 0 ``` ### Percentage Discounts ```text 0 < value <= 100 ``` Additionally, existing discount records should be validated before calculation to prevent malformed data from influencing pricing logic. --- ## Environment ```text Shopper Framework 2.8.1 Laravel 12.61.1 PHP 8.4.16 SQLite ```

CVE-2026-56831 Affected Shopper Versions

1 component(s)
Fixed Versions:
2.9.0
Product / Package Ecosystem Affected Versions Fixed Version
shopper/framework
Packagist
< 2.9.0
2.9.0

References

Frequently Asked Questions

What is CVE-2026-56831?
CVE-2026-56831 is a security vulnerability in Shopper involving Negative discount values accepted and propagated through order calculation pipeline under CWE-20: Improper Input Validation.
Which Shopper versions are affected?
Affected versions include releases prior to 2.9.0 across affected packages: shopper/framework.
What version fixes CVE-2026-56831?
Upgrading to 2.9.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is shopper/framework affected?
Yes, shopper/framework is affected in releases prior to 2.9.0. Upgrade your dependency to 2.9.0 or later.
What is the CVSS score of CVE-2026-56831?
CVE-2026-56831 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-56831?
CVE-2026-56831 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Packagist dependencies for CVE-2026-56831?
Run the dependency tree command: 'inspect dependencies for shopper/framework'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5vf4-452p-jjhf",
  "modified" : "2026-09-11T21:28:00Z",
  "published" : "2026-09-11T21:28:00Z",
  "aliases" : [ "CVE-2026-56831" ],
  "summary" : "Shopper: Negative discount values accepted and propagated through order calculation pipeline",
  "details" : "## Summary\n\nThe Shopper Framework discount management functionality accepts negative discount values without server-side validation.\n\nIt was confirmed that negative fixed-amount discounts can be created through the administrative interface, persisted to the database, and subsequently processed by the cart/order calculation pipeline.\n\nThe application appears to assume that discount values are always positive but does not enforce this assumption during creation, storage, or calculation.\n\nAs a result, malformed discount records can influence financial calculations and produce unintended order totals.\n\n---\n\n## Affected Product\n\n**Package:** shopper/framework\n\n**Version Tested:** 2.8.1\n\n---\n\n## Vulnerability Type\n\n* Business Logic Vulnerability\n* Improper Input Validation (CWE-20)\n\n---\n\n## Description\n\nWhile reviewing the discount functionality, it was discovered that the application accepts negative discount values through the administrative interface.\n\nExample values tested:\n\n```text\n-50.00\n-99,999,999.00\n```\n\nThe application accepted these values without validation and stored them in the database.\n\nExample records observed in the `sh_discounts` table:\n\n```text\n1 | QCZ5Y3HESM | fixed_amount | -5000\n4 | TOZKAHCB4S | fixed_amount | -9999999900\n```\n\nThis demonstrates that negative discount values are successfully persisted.\n\n---\n\n## Steps to Reproduce\n\n### 1. Create a Discount\n\nLogin as an administrator.\n\nNavigate to:\n\n```text\n/cpanel/discounts\n```\n\nCreate a new discount with the following values:\n\n```text\nType: fixed_amount\nValue: -99999999\n```\n\nSave the discount.\n\n### 2. Observe Successful Creation\n\nThe discount is accepted by the application and displayed in the administration interface.\n\nExample:\n\n```text\nCode: TOZKAHCB4S\nAmount: -$99,999,999.00\n```\n\n### 3. Verify Database Persistence\n\nInspect the database:\n\n```sql\nselect * from sh_discounts;\n```\n\nObserved entry:\n\n```text\nTOZKAHCB4S | fixed_amount | -9999999900\n```\n\n---\n\n## Technical Analysis\n\n### Discount Calculation\n\nFile:\n\n```text\nvendor/shopper/cart/src/Discounts/DiscountCalculator.php\n```\n\nObserved code:\n\n```php\n$fixedAmount = $discount->value;\n```\n\nThe value is later processed without validation:\n\n```php\n$fixedAmount = min($fixedAmount, $applicableSubtotal);\n```\n\nWhen a negative value is supplied:\n\n```php\nmin(-9999999900, 10000)\n```\n\nreturns:\n\n```php\n-9999999900\n```\n\nallowing the negative value to continue through the calculation pipeline.\n\nThe resulting adjustment values are inserted into the database:\n\n```php\nCartLineAdjustment::query()->insert($adjustments);\n```\n\nNo validation was identified to ensure that discount amounts are positive before calculations occur.\n\n---\n\n### Final Total Calculation\n\nFile:\n\n```text\nvendor/shopper/cart/src/Pipelines/Calculate.php\n```\n\nObserved logic:\n\n```php\n$context->total = max(\n    0,\n    $context->taxInclusive\n        ? $context->subtotal - $context->discountTotal\n        : $context->subtotal - $context->discountTotal + $context->taxTotal\n);\n```\n\nBecause negative discount values are allowed to reach this stage, financial calculations are performed using malformed discount data.\n\nExample:\n\n```text\nSubtotal      = 10000\nDiscountTotal = -5000\n```\n\nResulting calculation:\n\n```text\n10000 - (-5000)\n```\n\nResult:\n\n```text\n15000\n```\n\nThis demonstrates that negative discount values directly affect order total calculations.\n\n---\n\n## Impact\n\nThe following was confirmed:\n\n* Negative discount values are accepted.\n* Negative discount values are persisted.\n* Negative discount values are processed by the discount calculation engine.\n* Negative discount values affect order total calculations.\n\nPotential consequences include:\n\n* Incorrect pricing calculations.\n* Financial data integrity issues.\n* Unexpected order totals.\n* Violated assumptions within downstream pricing logic.\n* Future vulnerabilities if additional components assume discount values are always positive.\n\nBecause Shopper is a headless e-commerce administration framework and does not ship with a customer-facing storefront, it was not verified a customer-facing exploitation path.\n\nHowever, malformed discount records currently propagate through pricing calculations without validation.\n\n---\n\n## Recommendation\n\nImplement server-side validation enforcing positive discount values before persistence and before entering the calculation pipeline.\n\nSuggested validation:\n\n### Fixed Amount Discounts\n\n```text\nvalue > 0\n```\n\n### Percentage Discounts\n\n```text\n0 < value <= 100\n```\n\nAdditionally, existing discount records should be validated before calculation to prevent malformed data from influencing pricing logic.\n\n---\n\n## Environment\n\n```text\nShopper Framework 2.8.1\nLaravel 12.61.1\nPHP 8.4.16\nSQLite\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "shopper/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/shopperlabs/shopper/security/advisories/GHSA-5vf4-452p-jjhf"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/shopperlabs/shopper"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-11T21:28:00Z",
    "nvd_published_at" : null
  }
}