Eidpermissions race condition causes intermittent EID stripping
メンテナーはふだん 7 日以内に返信
@anishb-ms がすでに取り組んでいます。
2026年5月28日 から。
評価
この issue はまだ評価されていません。
説明
Context
We are working with requests to PBS that contain an EID and a corresponding entry under eidpermissions. (See attached example using source ceeid.eu.)
Observed behaviour
We observe intermittent behaviour from PBS: sending an identical request to PBS many times causes the requests to the bidders to be sometimes constructed with the EID, sometimes without. Here are three different examples that PBS generated in response to the identical incoming example request linked above.
Expected behaviour
100x identical requests to PBS --> 100x identical requests to all bidders.
Troubleshooting so far
I asked Claude to analyse why this is the case and it pinpointed the following limitation in the PBS codebase. Would be great if a more knowledgeable person could check whether this analysis holds up.
Claude Analysis
Problem
When Prebid Server processes an auction with multiple bidders and ext.prebid.data.eidpermissions configured, EIDs are intermittently stripped from bidder requests that should be permitted to receive them.
In our captured sport.cz request, source ceeid.eu is explicitly allowed for adform, adf, and sspBC. The outbound requests showed:
| Bidder | Permitted? | Received ceeid.eu? |
|---|---|---|
| adform | yes | yes |
| adf | yes | no |
| sspBC | yes | no |
| ix | no | no (correct) |
Sending the same request again produces a different subset of bidders that get ceeid.eu — the behaviour is non-deterministic.
Root cause
A shared-state bug in upstream exchange/utils.go. In the per-bidder loop in cleanOpenRTBRequests:
reqWrapperCopy := req.CloneAndClearImpWrappers()
bidRequestCopy := *req.BidRequest // shallow struct copy
reqWrapperCopy.BidRequest = &bidRequestCopy
reqWrapperCopy.Imp = impsbidRequestCopy := *req.BidRequest is a shallow copy. The User field is a *openrtb2.User, so every per-bidder copy in the loop points at the same User struct. User.EIDs is therefore shared across all bidders.
removeUnpermissionedEids then mutates that shared state:
reqWrapper.User.EIDs = eidsAllowedThe loop is for bidder, imps := range impsByBidder — and Go map iteration order is randomised. Whichever bidder gets filtered first wins:
- If a non-permitted bidder (e.g.
ix) is processed first, it removesceeid.eufrom the sharedUser.EIDs. Every bidder processed after it sees the already-filtered list, even if they were permitted. - If a permitted bidder is processed first, its filter takes an early-exit and doesn't mutate.
In our captured request, the iteration order happened to be roughly adform → ix → (adf, sspBC), which is why only adform retained ceeid.eu.
Scope
- Affects upstream Prebid Server, not just our
pbs-go/4.0.0pfork. - Triggers whenever
eidpermissionsis configured AND at least one bidder in the auction is excluded from a source that another bidder is permitted for. - Symptoms scale with number of bidders and number of excluded sources — silent data loss with no error logged.
Recommended fix
In cleanOpenRTBRequests, deep-copy User (or at minimum the EIDs slice) before any per-bidder mutation:
if bidRequestCopy.User != nil {
userCopy := *bidRequestCopy.User
userCopy.EIDs = slices.Clone(bidRequestCopy.User.EIDs)
bidRequestCopy.User = &userCopy
}Other per-bidder mutators on User (e.g. buyeruid assignment, GDPR/consent handling) may have the same exposure and should be audited as part of the fix.
Suggested actions
- Patch with the deep-copy fix above
- Verify with a load test that hammers the same
sport.czrequest and confirms 100% of permitted bidders receiveceeid.eu. - Audit other per-bidder mutations in
cleanOpenRTBRequestsfor the same shared-pointer pattern.
References
- exchange/utils.go —
cleanOpenRTBRequests,removeUnpermissionedEids - openrtb_ext/convert_down.go —
moveEIDFrom26To25 - static/bidder-info/adform.yaml — confirms
adformis alias ofadf(rules out adapter-specific behaviour)
monetize_to_psp.json
psp_response_1.json
psp_response_2.json
psp_response_3.json
- 主要言語
- Go
- スター
- 581
- フォーク
- 967
- 平均マージ
- 3日 14時間
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
prebid/prebid-server のほかの issue
-
Unauthenticated CPU-exhaustion DoS via infinite loop in /setuid priority cookie ejector対応中かも @karwaankit32 が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
prebid/prebid-server#5089 · 担当者 1 名 ·
メンテナーはふだん 7 日以内に返信
-
Port PR from PBS-Java: Nexx360: declare vendor IDs for easybid, 1accord and prismassp aliases対応中かも @gchicoye が 30 日前に担当しました。 オープンauto
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
prebid/prebid-server#5073 ·
メンテナーはふだん 7 日以内に返信
-
Port PR from PBS-Java: Smartadserver: forward placementuuid as plcmtuuid対応中かも @plsgard が 59 日前に担当しました。 オープンauto
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
prebid/prebid-server#5022 ·
メンテナーはふだん 7 日以内に返信
-
Port PR from PBS-Java: New Adapter: Sevio対応中かも @daniel-gheorghian-sevio が 178 日前に担当しました。 オープンauto
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
prebid/prebid-server#4928 · コメント 1 件 ·
メンテナーはふだん 7 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
prebid/prebid-server#4913 · コメント 1 件 ·
メンテナーはふだん 7 日以内に返信
prebid/prebid-server の issue をすべて見る
似ている issue
-
iOS: Clear Context (/clear) and model picker fallback use negative agent check instead of isClaudeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
go good first issue test
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
bug github_actions good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
libr-forum/libr#77 ·
メンテナーはふだん 1 日以内に返信
-
[UI] Guard webApis against undefined window in SSR environments対応中かも @madhavzanwar が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信