Add ad.doubleclick.net to CSP connect-src - #2052
Conversation
Marketing flagged this as a problem in the GTM configuration for approved events: GTM reports connect-src violations against https://ad.doubleclick.net, so the tag cannot fire. The existing doubleclick entries cover the other directives (stats.g.doubleclick.net in connect-src, td.doubleclick.net in frame-src, *.g.doubleclick.net in script-src), but nothing permitted XHR/beacon traffic to ad.doubleclick.net. Kept inline on the existing connect-src line, per the warning in this file that newlines in the CSP block previously broke prod.
⚪ Code HealthNo change to the dead-code surface. 48 Unused files
66 Unused exports
30 Unused exported types
14 Unused exported enum members
5 Unused dependencies
3 Unused devDependencies
|
Issues
No issue filed. Reported by marketing as a problem in the GTM configuration for
approved events: the tag targeting
https://ad.doubleclick.netcannot firebecause our CSP blocks it.
Changes
https://ad.doubleclick.netto theconnect-srcdirective inpublic/nginx.conf.https://stats.g.doubleclick.netso the doubleclick hosts stay grouped, and kept on a single line per the
warning in this file that newlines in the CSP block previously broke prod.
Context on why this was missing:
ad.doubleclick.nethas never been present inthis file, so this is not a re-add of something previously removed. The other
doubleclick hosts were enumerated in Oct 2024 (#1316, #1332) from observed CSP
violation reports, during a window when
connect-srcstill carried a barehttps:wildcard. That wildcard was dropped in #1346, which is when theenumeration became restrictive. This host simply never appeared in a report at
the time.
Existing doubleclick coverage for reference:
connect-srcstats.g.doubleclick.net,ad.doubleclick.net(new)frame-srctd.doubleclick.netscript-src*.g.doubleclick.netNote that
img-srcis'self' data: https:, so image-based pixels on anydoubleclick host were already permitted regardless of this change.
Tests
Manually tested
not apply
public/nginx.confundernpm start, so the change is inertlocally. Needs verification in a deployed environment by confirming the GTM
connect-srcviolation forad.doubleclick.netno longer appears in thebrowser console, and that marketing sees the approved events landing.
Automated tests
Playwright tests ran locally
Not run: this change only affects the nginx-served CSP header, which is not
applied under the Vite dev server these tests run against. Every suite would
behave identically with and without this commit.
Screenshots
Not applicable, no UI change.