Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebid Server cookie sync race condition #3265

Closed
dbemiller opened this issue Nov 5, 2018 · 1 comment · Fixed by #3393
Closed

Prebid Server cookie sync race condition #3265

dbemiller opened this issue Nov 5, 2018 · 1 comment · Fixed by #3393
Assignees
Labels
bug pinned won't be closed by stalebot

Comments

@dbemiller
Copy link
Contributor

Type of issue

Bug

Description

There's a race condition in the prebidServerBidAdapter cookie sync code: https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter/index.js#L119

Prebid Server's /setuid endpoint behaves like so:

  1. Unpack the Cookie sent in the request, to get existing user IDs.
  2. Update the data inside the Cookie with the new Bidder/UID
  3. Respond with a Set-Cookie header with the updated data.

Suppose two syncs get executed, and the second one gets sent before the first one returns. The same Cookie data will be sent to both. Both /setuid calls will respond with Set-Cookie headers, but neither one will contain the other one's data. After both execute, the final cookie will only have the updated ID from the last /setuid response to return.

Steps to reproduce

Since this is a race condition, it's inherently impossible to reproduce reliably. To increase the chances of reproducing it, run an auction with all the Prebid Server bidders. Use a baset64 decoder to decode the PBS cookie, and see whether all the bidders have syncs there.

In practice, there's probably not much value in reproducing it. To fix it, just do your best to avoid running two Prebid Server cookie syncs at the same time.

@dbemiller dbemiller added the bug label Nov 5, 2018
@bretg bretg added the pinned won't be closed by stalebot label Dec 12, 2018
@mkendall07
Copy link
Member

Agree this is a bug. We can address in Q1 unless someone want's to work on it now.

@jsnellbaker jsnellbaker self-assigned this Dec 18, 2018
mkendall07 pushed a commit that referenced this issue Jan 3, 2019
* Fix #3265 - pbs cookie sync race condition

* add/update jsdoc comments
olafbuitelaar pushed a commit to olafbuitelaar/Prebid.js that referenced this issue Jan 3, 2019
* Fix prebid#3265 - pbs cookie sync race condition

* add/update jsdoc comments
amuraco pushed a commit to amuraco/Prebid.js that referenced this issue Jan 28, 2019
* Fix prebid#3265 - pbs cookie sync race condition

* add/update jsdoc comments
ghost pushed a commit to devunrulymedia/Prebid.js that referenced this issue Jan 30, 2019
* Fix prebid#3265 - pbs cookie sync race condition

* add/update jsdoc comments
pedrolopezmrf pushed a commit to Marfeel/Prebid.js that referenced this issue Mar 18, 2019
* Fix prebid#3265 - pbs cookie sync race condition

* add/update jsdoc comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pinned won't be closed by stalebot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants