CubeCart, the open-source PHP shopping-cart software used by small online shops, released version 6.8.7 on Dec 2 to fix a critical flaw that lets an anonymous visitor run code on the server. The release notes shipped inside 6.8.7 say the bug is "already being used against stores" and tell every store to upgrade now.
Why it matters: the flaw needs no login and sits in session handling, which every storefront visitor touches. A compromised shop server holds customer records and checkout pages, the usual target for card skimmers. There is no CVE number yet; the bug is tracked as GitHub advisory GHSA-86w8-pwv3-4vph.
What we verified in CubeCart's code
We cloned the official cubecart/v6 repository and checked the release ourselves:
- The fix is a one-line change in
classes/session.class.php(commit f1a9f32f, Dec 2 21:14 UTC, by CubeCart's Al Brookbanks). Inside the legacy session decoder,unserialize()was called with'allowed_classes' => true; it now usesfalse, so session data can only come back as plain values, never PHP objects. - The
6.8.7tag was cut on Dec 2 (21:26 UTC) and setsCC_VERSIONto 6.8.7. - The vulnerable line is present in the 6.6.0, 6.7.5 and 6.8.6 tags and absent from 6.5.12, where the legacy decoder does not exist. That matches the affected range of 6.6.0 through 6.8.6 reported by SecurityOnline.
The 6.8.7 release notes list three security fixes:
| Advisory | Severity (CubeCart) | What the fix does |
|---|---|---|
| GHSA-86w8-pwv3-4vph | Critical | Sessions are read back only as plain data, so a visitor can no longer plant PHP objects and run code |
| GHSA-jfqc-r63w-28cp | High | Storefront search sort can only name a plain column, closing an SQL injection |
| GHSA-q5mc-p7rv-945c | Low | Digital download keys are now random rather than predictable |
The release also updates bundled Smarty (to 4.6.0), PHPMailer (6.12.0) and Guzzle (7.16.3), and strips development packages from the Elasticsearch client folder.
How the attack works, and what attackers did
According to SecurityOnline, which summarised CubeCart's advisory, sessions have been stored in the database since 6.6.0. When strict decoding fails, CubeCart falls back to the legacy decoder that allowed any class. A guest can force that failure because the browser's Referer header is saved into the session and later mangled by a stripslashes() call, which breaks the serialized string lengths. A forged configuration object then writes a Smarty template into the store's copyright setting, and that template runs operating-system commands.
SecurityOnline reports that CubeCart's advisory describes live attacks on Dec 2 against a shop running 6.7.5: the attackers edited the copyright text, ran commands, dropped web shells into the images/ folder, then put the original copyright text back to cover their tracks. No IP addresses, file hashes or attacker names have been published. We could not open the GitHub advisory pages themselves this run, so those details are secondhand.
The SQL injection (GHSA-jfqc-r63w-28cp) affects 6.5.12 through 6.8.6 and needs no login either, per SecurityOnline, which rates it CVSS 7.5. No attacks on it have been reported.
What to do
- Upgrade to 6.8.7 now. It is the only release that fixes all three issues.
- If you can't upgrade today, apply the one-line fix: in
classes/session.class.php, in the legacy session decoder, change'allowed_classes' => trueto'allowed_classes' => false. This is exactly what CubeCart's commit does. It does not fix the SQL injection. - Assume you may already be compromised if you ran 6.6.0–6.8.6 on a public site:
- look for unexpected
.phpfiles underimages/; - check the store copyright and other text settings in the admin for template code, even if the visible text looks normal;
- review web-server logs for odd Referer or User-Agent values containing serialized PHP (strings like
O:followed by a class name).
- look for unexpected
- SecurityOnline also lists extra hardening from the advisory: removing
filter_varfrom the Smarty allowlist and blocking serialized-object markers in Referer and User-Agent headers at your web application firewall. - If you find a web shell, treat the server as breached: rotate database, admin and payment-gateway credentials, and check checkout templates for injected skimming scripts.
Who should care: anyone running a self-hosted CubeCart store, and hosting companies with CubeCart in their one-click installers. Watch for a CVE assignment and for CubeCart's advisory to add indicators of compromise.
Sources
- CubeCart v6 on GitHub — 6.8.7 release notes (admin/sources/release_notes/6.8.7.inc.php) github.com
- CubeCart v6 on GitHub — commit f1a9f32f: GHSA-86w8-pwv3-4vph legacy session decoder returns plain data only github.com
- Daily CyberSecurity (SecurityOnline) — CubeCart RCE Flaw Actively Exploited, Patch Now securityonline.info