Repository navigation
Conversation
Prebid.js 11.14 through 11.53 resolve a consent handler without data before userId first reads its hash, which leaves the cached hash unset, so the combined hash joins an empty string for it. 11.54 restored the hash of JSON null. The newer formats hashed null for every release, so a TCF-only page on 11.14 through 11.53 still had its companion rewritten. Make with-coppa and with-addtl-consent contribute an empty string for a handler without data, narrow with-addtl-consent to 11.41 through 11.53, and add with-null-hash for 11.54 onward. Recompute the unit, GPP and application write-back vectors and update the guides and spec.
…ntegration chain
|
Merged #1614's Trusted Server owns the This merge takes #1722's new head ( Checks on this head: no conflict markers; |
Summary
_cstcompanion to the publisher's Prebid.js hash format, so matching consent does not make Prebid replace the server's cookie after navigation.[integrations.prebid].consent_hash_formatwithlegacy(default),with-coppa,with-addtl-consent, andwith-null-hash. Resolve it once at startup and reject unknown names instead of silently falling back._cstcookie #1735's raw GPP applicable-section hashing, including sentinels, and document the unsupported AC, GCM, and non-default COPPA cases.Stacked on #1722 (
fix/1686-gpp-applicable-sections), starting at80d1ee52f, which contains the #1735 fix. This PR targets that branch. Its existing US-geolocation review concern remains outside this change.Design and behavior
The server previously always used the Prebid 10.26 format. Publishers can now select the format their external bundle uses:
legacy0nullwith-coppafalsewith-addtl-consentfalsewith-null-hashfalsenullA "handler without data" is a TCF, US Privacy, or GPP consent handler whose module is absent from the bundle or which resolved no consent. Prebid.js 11.14 replaced the consent handler class with a factory whose
resolvesets the cached hash's dirty flag to whether the data changed. A handler without data is resolved beforeuserIdfirst readsallConsent.hash; its data never changes from the initial null, so the cached hash stays unset andArray.joincontributes an empty string. Prebid.js 11.54 changed the flag todirty || changed, restoring the hash of JSONnull. A fingerprint of the hash-relevant lines of every 11.x tag shows exactly these four regimes.A named format selects the behavior directly without maintaining a version parser. The default preserves existing vectors and matches the locked Prebid 10.26.0 bundle;
^10.26.0excludes 11.x. Selecting a newer format changes the companion hash, including on requests without TCF, without changing consent enforcement or identity eligibility.Tagged-source reproduction uncovered a COPPA change at 11.14.0 and the handler-caching change above. With the existing test TC string and no other consent signals, tagged outputs are:
_cstFpjVEA==S0Rasw==kH3xXg==rW19lA==2~1.2~dv.efIszA==The issue's
IuPFqQ==and2Bt6SA==also reproduce, but only when the new TCF field list retains the legacy literal COPPA contribution. They are isolated field-change vectors rather than stock cookie hashes.These values were computed in a throwaway Node 24 script from the tagged
cyrb53Hash, consent handler hash caching for each regime, and User ID'sgetConsentHashcookie encoding. Tagged 11.13 and 11.14 establish the COPPA and caching boundary; 11.41 establishes the third TCF field; 11.54 restores the null hash and adds the opt-in GCM handler. The legacy and 11.54 results reproduce every earlier vector unchanged. Combined TCF/GPP sentinel vectors were reproduced for all four formats too.Known mismatches
addtlConsent: request transport remains deferred;with-addtl-consentandwith-null-hashhash null when no AC is available. EC-POST-only transport would lose AC on the next navigation.coppa = true: the server formats assume disabled COPPA.Changes
crates/trusted-server-core/src/integrations/prebid.rscrates/trusted-server-core/src/ec/app.rscrates/trusted-server-core/src/ec/app/lifecycle.rscrates/trusted-server-core/src/ec/sharedid.rscrates/trusted-server-core/src/ec/app/route_tests.rscrates/trusted-server-core/src/test_support.rstrusted-server.example.tomldocs/guide/integrations/prebid.mddocs/guide/edge-cookies.mddocs/superpowers/specs/2026-12-04-1736-prebid-cst-hash-design.mddocs/superpowers/plans/2026-12-04-1736-prebid-cst-hash.mdCloses
Closes #1736
Spec
Spec: Configurable Prebid consent hash format
Test plan
Targeted local checks used Rust 1.98.1 and Node 24.20.0. GitHub Actions will run the remaining gates; the full CI suite was not run locally.
Native core library: 4003 passed, 2 ignored. Configuration, tagged hashes for all four formats, GPP sentinels, startup rejection, disabled-integration semantics and EC POST cookie replay are covered. Disabling the empty-handler contribution fails the unit, GPP and application write-back vectors.
cargo test-axum: 147 passed, 4 ignored.Core native
clippy --all-targets --all-features -- -D warnings,cargo clippy-axumandcargo clippy-fastlypassed. The inheritedresult_large_errfailure was first reproduced on the exact base, then addressed with a scoped test-helper allowance.cargo fmt --all -- --check; changed-document Prettier, whitespace, and changed-line domain checks passed.Core documentation built; 31 warnings remain.
Axum runtime verification of the first commit with
geo-cloudfront, a controlled local origin, synthetic protected GB ingress, fresh consented TCF, and real prepared record storage: the server emitted the configured format, a second navigation left matching SharedID and companion cookies untouched, and omitting the setting returned legacy hashes. The corrected intermediate vectors are covered through the same application write-back and cookie replay inec_route_uses_configured_consent_hash_format_without_rewriting_matching_cookies. No browser was run.Fastly/Cloudflare/Spin runtime and WASM gates: left to CI.
Full JS and documentation suites: left to CI.
Checklist
unwrap()in production code.