Commerce Product Alternative
The module fails to check who owns a shopping basket when the visitor is not logged in. Anyone could view the names and prices of items in other visitor baskets and swap them for alternatives. They could uncover hidden details and alter basket contents.
- Who could do thisAnyone visiting the site. No login needed.
- Does it apply to youSites are affected only for the shopping baskets of visitors who are not logged in.
- Has it been used in attacksNo sign of it.
- How urgentDrupal rates this critical. Cyber Essentials expects a fix within 14 days. Do it this week.
Tell your developerUpdate Commerce Product Alternative to 1.0.1.
For developers: what the fix changed
Updates `SwitchAccessChecker::access` to verify cart ownership using `CartProviderInterface::getCartIds` instead of comparing customer IDs, ensuring anonymous users can only access carts tied to their own session. It also disables caching for the switch route in `commerce_product_alternative.routing.yml`.
Also in this release Added a kernel test to verify access control for anonymous and authenticated carts.
commerce_product_alternative.routing.yml+2 −0 fixsrc/Access/SwitchAccessChecker.php+8 −4 fix