Suppress fabricated empty Prebid bidder params#910
Open
prk-Jr wants to merge 3 commits into
Open
Conversation
A configured bidder with no inline params and no matching override
expanded to `"bidder": {}`, which PBS rejects. After applying overrides,
drop fabricated empty bidders, preserve an explicitly supplied empty
object so genuine misconfiguration stays visible, and fall back to the
stored-request path when no eligible bidders remain.
d3fa16b to
ef61953
Compare
ChristianPavilonis
approved these changes
Jul 15, 2026
ChristianPavilonis
left a comment
Collaborator
There was a problem hiding this comment.
Review Summary
Approved with one non-blocking medium-severity finding documented inline. The primary fabricated-empty suppression, override ordering, and stored-request fallback behavior are covered by focused tests.
Please address the inline mixed-representation precedence case in follow-up work before relying on this path for clients that can send both direct bidder params and trustedServer.bidderParams.
aram356
requested changes
Jul 15, 2026
aram356
left a comment
Collaborator
There was a problem hiding this comment.
Summary
The fabricated-empty suppression, override ordering, stored-request fallback, and focused tests are otherwise sound, but mixed bidder representations can still recreate the invalid empty bidder object nondeterministically.
Blocking
🔧 wrench
- Mixed bidder representations have nondeterministic precedence: direct bidder params can be overwritten by a fabricated empty object depending on
HashMapiteration order (crates/trusted-server-core/src/integrations/prebid.rs:1440).
CI Status
- GitHub integration checks: PASS (4/4)
- fmt: PASS locally
- focused native core tests: PASS (44/44)
- Fastly test runtime: BLOCKED locally by unavailable macOS certificate keychain after successful compilation
- clippy-fastly: BLOCKED locally by a build-script tooling error (
Unrecognized option: 'p') - JS tests: not run; no JS/TS files changed
A slot can carry both a direct bidder entry with valid inline params and a
trustedServer entry whose bidderParams omits that bidder. Because slot.bidders
is a HashMap, the trustedServer expansion (which fabricates an empty {} for the
omitted bidder) could run after the direct entry and overwrite its valid params
via extend. The direct entry already marked the bidder explicit, so the empty
object survived the retention drop and PBS rejected the impression — the failure
this path is meant to eliminate — nondeterministically, depending on iteration
order.
Replace the extend with an entry().or_insert() loop so trustedServer-expanded
bidders only fill in absent entries and direct params win regardless of order.
Add a looped regression test exercising a slot with both representations.
…' into fix/prebid-suppress-empty-bidder-params
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #899 (
feat/ssat-render-inline-creative) — base branch is that PR's head, notmain.A configured Prebid bidder with no inline params and no matching bid-param override was expanded into
"bidder": {}in the OpenRTB request. PBS rejects an empty bidder object, surfacing as the intermittent auction error.Fix
In
to_openrtb(crates/trusted-server-core/src/integrations/prebid.rs):{}).Behavior contract:
"bidder": {}).{}→ preserved (misconfiguration stays visible).The browser half of this defense (
prevBidderParamsretention on refresh) already shipped; this completes the server half.Tests
New unit tests in
prebid.rs:to_openrtb_drops_fabricated_empty_bidder_paramsto_openrtb_preserves_an_explicitly_empty_bidderto_openrtb_keeps_a_fabricated_bidder_that_an_override_populatesto_openrtb_falls_back_to_stored_request_when_all_bidders_are_fabricated_emptyVerification
cargo fmt --all -- --check✓cargo clippy-fastly✓cargo test-fastly✓ (1628 core + 99 fastly, 0 failed)Test plan
"bidder": {}to PBS