Skip to content

Keep a server-reported opt-out when the browser sends an unchanged cookie #1602

Open

Description

@dhruv8sh

Follow-up from PR #1488 (review by prk-Jr, thread).

Description

Reviewer's finding (P1): "Any usable cookie is treated as proof of opting back in. A UID2 server refresh, however, never rewrites the browser cookie. A two-navigation reproduction first refreshes a due identity, receives a server opt-out, clears the source and persists opt-out memory. The next navigation sends the same unchanged cookie: this branch produces Found with OptOutMemory::Forget, allowing the cleared token to return without a new vendor lookup."

In crates/trusted-server-core/src/ec/coordinator/mod.rs (~lines 590-596, CookieRead::Found branch), any usable cookie sets opted_back_in and OptOutMemory::Forget, which clears the remembered opt-out the server recorded.

Reproduction

  1. Navigation 1: a due UID2 identity is refreshed server-side; the vendor answers with an opt-out. The source is cleared and opt-out memory is persisted.
  2. Navigation 2: the browser sends the same, unchanged pre-opt-out cookie.
  3. The coordinator treats the cookie as an opt-back-in, forgets the opt-out and restores the cleared token.

Expected behavior

A server-reported opt-out stays in force until there is evidence of a genuinely new ID. Legitimate opt-back-in (a freshly issued cookie ID) still clears the memory.

Possible approaches (both change the stored per-visitor record):

  • Store a fingerprint of the cookie value seen at opt-out time in the opt-out record, and only forget the opt-out when the cookie differs.
  • Compare the cookie's issue time with the recorded opt-out time, and only forget the opt-out for a cookie issued after it.

Done when

  • An unchanged pre-opt-out cookie no longer clears a server-reported opt-out.
  • A cookie carrying a genuinely new ID still clears it.
  • A two-navigation lifecycle regression test covers both cases.

Affected area

Core (Edge Cookies, GDPR)

Code: crates/trusted-server-core/src/ec/coordinator/mod.rs (cookie read / remembered opt-out handling), opt-out record in the KV row types.

Activity

  1. added this to the 202611 milestone on Nov 13, 2026
  2. added theissue type on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions