Order Attribution cookies causing intermittent HTTP 400
-
Hi,
We’re seeing intermittent400 Bad Requesterrors on storefront pages. Origin server confirmed healthy – an anonymous, cookie-less request to any product page returns200 OKand renders fully. The failure is request-specific, tied to the size of theCookierequest header, which is hitting the server’s header-buffer limit (8192 bytes on Apache/nginx).Root cause identified:
Order Attribution (which bundlessourcebuster.js—wp-content/plugins/woocommerce/assets/js/sourcebuster/sourcebuster.js) sets two cookies that store the entire landing-page URL and the entire referrer URL as plain text, not a truncated value, not a hash, not a reference ID:sbjs_current_add— full “current” landing URLsbjs_first_add— full “first ever” landing URL
Example sizes we’re capturing from real visitor sessions:- sbjs_current_add = 783 bytes
- sbjs_first_add = 781 bytes
Our site with: - Faceted/filtered navigation producing long URL paths (our filter URLs routinely run 120–180+ characters, e.g.
/product-category/engagement-rings/style/vintage/filters/center_stone_type/morganite/diamonds/natural-diamond/material/14k-white-gold/style/side-stones-vintage), and - Paid traffic landing with long UTM/click-ID query strings appended to those URLs (
?utm_source=...&utm_campaign=...&fbclid=...&gclid=...)
these two cookies alone can approach or exceed 1.5KB combined, and they compound with every other marketing/analytics cookie set on the page (GA4, Meta Pixel, TikTok, Pinterest, etc.). In our own audit, the total
Cookieheader for a real returning visitor measured ~8,018 of 8,192 bytes (97.9%) across ~66 cookies, withsbjs_current_add/sbjs_first_addas the two single largest contributors (https://prnt.sc/pArgJ_jkUgjy). Any additional cookie, or a slightly longer landing URL on the next visit, pushes the request over the server’s header limit and it gets rejected with 400 before WordPress even loads — so nothing inwp_dieor any app-level hook can catch or log it.Because the cookie size fluctuates with the length of the URL a visitor happens to land on, the error is intermittent and hard to reproduce consistently — it depends entirely on traffic source and site URL structure, not on a fixed condition.
We can raiselarge_client_header_buffers/LimitRequestFieldSizeserver-side as symptom relief, but that doesn’t address the fact that the cookie payload will keep growing as more marketing tags are added over time.
Any idea how it can be solved w/o changinglarge_client_header_buffers/LimitRequestFieldSize?
I know that I can disable Order Attribution, but it’s also good data stored here for marketing, so I prefer to keep it.
Thank you!
You must be logged in to reply to this topic.