Skip to content

Ensure what cookie data is being forwarded to Prebid Server #763

@ChristianPavilonis

Description

@ChristianPavilonis

Summary

Trusted Server's Prebid integration currently forwards the incoming browser Cookie header to Prebid Server. This can disclose first-party publisher cookies and Trusted Server identity cookies across the SSP boundary.

This behavior appears to predate PR #680, but the new server-side publisher/page-bids auction paths make the risk more visible because ordinary page navigation traffic can trigger Prebid Server requests.

Problem

copy_request_headers() in the Prebid provider copies browser headers to the outgoing PBS request and calls the generic Fastly cookie forwarding helper. Depending on consent-forwarding mode, this can forward cookies such as:

  • ts-ec
  • ts-eids
  • sharedId
  • publisher session/auth cookies
  • analytics/personalization cookies
  • arbitrary first-party cookies

Identity and consent data should be sent intentionally through structured, consent-gated OpenRTB fields or through a narrow consent-cookie allowlist, not by forwarding the entire raw browser cookie header.

Desired behavior

Replace raw cookie forwarding to PBS with explicit allowlist behavior:

  • consent_forwarding = "openrtb_only": send no Cookie header to PBS.
  • consent_forwarding = "both": send OpenRTB consent fields and only allowlisted consent cookies.
  • consent_forwarding = "cookies_only": send only allowlisted consent cookies and omit OpenRTB consent fields as currently intended.
  • Never forward Trusted Server internal identity cookies or arbitrary publisher cookies.

Candidate allowlist:

  • euconsent-v2
  • __gpp
  • __gpp_sid
  • us_privacy

Any future non-consent cookie forwarding should require an explicit design and config option.

Suggested implementation

  • Replace compat::forward_fastly_cookie_header(...) usage in crates/trusted-server-core/src/integrations/prebid.rs with a Prebid-specific consent-cookie allowlist builder.
  • Add regression tests with a mixed cookie header, e.g.:
euconsent-v2=TC; __gpp=GPP; __gpp_sid=2; us_privacy=1YNN; ts-ec=abc; ts-eids=def; sharedId=ghi; session=secret

Assert that only consent cookies are forwarded when cookie forwarding is enabled, and no cookies are forwarded in openrtb_only mode.

Notes

This issue is being tracked separately so PR #680 can keep its review scope focused on the new server-side ad-template behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrustPull requests that update rust code

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions