Eidpermissions race condition causes intermittent EID stripping
Los mantenedores suelen responder en 7 días
@anishb-ms ya está trabajando en esto.
Desde el 28/5/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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
- Lenguaje dominante
- Go
- Estrellas
- 581
- Forks
- 967
- Merge medio
- 3 d 14 h
- PR fusionados (30 d)
- 2
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de prebid/prebid-server
-
Unauthenticated CPU-exhaustion DoS via infinite loop in /setuid priority cookie ejectorPosiblemente ocupada @karwaankit32 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
prebid/prebid-server#5089 · 1 asignado ·
Los mantenedores suelen responder en 7 días
-
Port PR from PBS-Java: Nexx360: declare vendor IDs for easybid, 1accord and prismassp aliasesPosiblemente ocupada @gchicoye la tomó hace 30 días. Abiertoauto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
prebid/prebid-server#5073 ·
Los mantenedores suelen responder en 7 días
-
Port PR from PBS-Java: Smartadserver: forward placementuuid as plcmtuuidPosiblemente ocupada @plsgard la tomó hace 59 días. Abiertoauto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
prebid/prebid-server#5022 ·
Los mantenedores suelen responder en 7 días
-
Port PR from PBS-Java: New Adapter: SevioPosiblemente ocupada @daniel-gheorghian-sevio la tomó hace 178 días. Abiertoauto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
prebid/prebid-server#4928 · 1 comentario ·
Los mantenedores suelen responder en 7 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
prebid/prebid-server#4913 · 1 comentario ·
Los mantenedores suelen responder en 7 días
Todos los issues de prebid/prebid-server
Issues similares
-
iOS: Clear Context (/clear) and model picker fallback use negative agent check instead of isClaudeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
bug github_actions good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
libr-forum/libr#77 ·
Los mantenedores suelen responder en 1 día
-
[UI] Guard webApis against undefined window in SSR environmentsPosiblemente ocupada @madhavzanwar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día