Repository navigation
Description
🤖 This issue was written by an AI agent (Claude Code) on behalf of @patmmccann.
What happens
AnalyticsReporterDelegator.isAllowedAdapter checks analytics.global.adapters and the account's analytics.modules.<name>.enabled (isNotAllowedAdapterByGlobalOrAccountAnalyticsConfig) only for AuctionEvent, AmpEvent, NotificationEvent and VideoEvent. CookieSyncEvent and SetuidEvent fall through to the default branch, which skips that check and passes a null activity infrastructure, so the event is allowed:
- (default branch at L218-L221)
Lines 175 to 225 in 9ac3345
private <T> boolean isAllowedAdapter(T event, String adapter) { final ActivityInfrastructure activityInfrastructure; final ActivityInvocationPayload activityInvocationPayload; switch (event) { case AuctionEvent auctionEvent -> { if (isNotAllowedAdapterByGlobalOrAccountAnalyticsConfig(adapter, auctionEvent.getAuctionContext())) { return false; } final AuctionContext auctionContext = auctionEvent.getAuctionContext(); activityInfrastructure = auctionContext != null ? auctionContext.getActivityInfrastructure() : null; activityInvocationPayload = auctionContext != null ? BidRequestActivityInvocationPayload.of( activityInvocationPayload(adapter), auctionContext.getBidRequest()) : null; } case AmpEvent ampEvent -> { if (isNotAllowedAdapterByGlobalOrAccountAnalyticsConfig(adapter, ampEvent.getAuctionContext())) { return false; } final AuctionContext auctionContext = ampEvent.getAuctionContext(); activityInfrastructure = auctionContext != null ? auctionContext.getActivityInfrastructure() : null; activityInvocationPayload = auctionContext != null ? BidRequestActivityInvocationPayload.of( activityInvocationPayload(adapter), auctionContext.getBidRequest()) : null; } case NotificationEvent notificationEvent -> { if (isNotAllowedAdapterByGlobalOrAccountAnalyticsConfig(adapter, notificationEvent.getAccount())) { return false; } activityInfrastructure = notificationEvent.getActivityInfrastructure(); activityInvocationPayload = activityInvocationPayload(adapter); } case VideoEvent videoEvent -> { if (isNotAllowedAdapterByGlobalOrAccountAnalyticsConfig(adapter, videoEvent.getAuctionContext())) { return false; } activityInfrastructure = null; activityInvocationPayload = null; } case null, default -> { activityInfrastructure = null; activityInvocationPayload = null; } } return isAllowedActivity(activityInfrastructure, Activity.REPORT_ANALYTICS, activityInvocationPayload); } Lines 234 to 251 in 9ac3345
private boolean isNotAllowedAdapterByGlobalOrAccountAnalyticsConfig(String adapter, Account account) { final Map<String, ObjectNode> modules = Optional.ofNullable(account) .map(Account::getAnalytics) .map(AccountAnalyticsConfig::getModules) .orElse(null); if (modules != null && modules.containsKey(adapter)) { final ObjectNode moduleConfig = modules.get(adapter); if (moduleConfig == null || !moduleConfig.has("enabled")) { return false; } return !moduleConfig.get("enabled").asBoolean(); } return !globalEnabledAdapters.contains(adapter); }
As a result, every reporter bean that has been created gets cookie sync and setuid events. That includes reporters that are left out of analytics.global.adapters and reporters an account has turned off with "enabled": false. The only filter is the host-level TCF Purpose 7 check in processEvent(event, tcfContext).
The account is available in both handlers (SetuidContext.account, CookieSyncContext.account), but it isn't put on the events:
prebid-server-java/src/main/java/org/prebid/server/handler/CookieSyncHandler.java
Lines 218 to 223 in 9ac3345
final CookieSyncEvent event = CookieSyncEvent.builder() .status(status.code()) .bidderStatus(cookieSyncResponse.getBidderStatus()) .build(); analyticsDelegator.processEvent(event, cookieSyncContext.getPrivacyContext().getTcfContext()); prebid-server-java/src/main/java/org/prebid/server/handler/SetuidHandler.java
Lines 311 to 318 in 9ac3345
final TcfContext tcfContext = setuidContext.getPrivacyContext().getTcfContext(); final SetuidEvent setuidEvent = SetuidEvent.builder() .status(statusCode) .bidder(cookieFamilyName) .uid(uid) .success(uidsCookieUpdateResult.isUpdated()) .build(); analyticsDelegator.processEvent(setuidEvent, tcfContext);
Why it matters
Functional and privacy. analytics.global.adapters and the account enabled flag are how hosts and publishers decide which reporters get data. If a publisher has turned a reporter off, that reporter could still get their users' cookie sync and setuid traffic, including the bidder UID on setuid (see #4718).
To reproduce
- Enable a reporter, e.g.
pubstack.enabled: true, but leave it out ofanalytics.global.adapters. Or keep it in the list and set accountacc1to{"analytics": {"modules": {"pubstack": {"enabled": false}}}}. - Call
/cookie_syncwith"account": "acc1", or/setuid?bidder=...&uid=...&account=acc1. - The reporter's
processEventreceives aCookieSyncEvent/SetuidEvent. A/openrtb2/auctionrequest for the same account doesn't reach it.
Expected behaviour
Cookie sync and setuid events respect analytics.global.adapters, and the account-level enabled flag when an account is known, in the same way as the other event types.
Suggested fix
Add the Account (and ActivityInfrastructure, see #4718) to CookieSyncEvent and SetuidEvent, and add matching branches to isAllowedAdapter. At minimum, apply the globalEnabledAdapters check in the default branch.
References
- Found while documenting PBS analytics events: Prebid Server: document analytics events for PBS-Go and PBS-Java prebid.github.io#6997
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity