Skip to content

fix: prevent cookie transfers during external data loads #15504

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

Merged
merged 3 commits into from
May 28, 2025
Merged

Conversation

wackerow
Copy link
Member

@wackerow wackerow commented May 23, 2025

Description

  • Prevent Cookie Transfer During XML Fetches: Updates fetch requests for XML files to use credentials: "omit", ensuring cookies are not sent with these requests.
  • No-Referrer Anonymous Image Loads: Sets the referrerPolicy="no-referrer" and crossOrigin="anonymous" attributes on certain <img> tags to enhance privacy and security when loading images from external sources.
  • Replaces an externally hosted image URL with an internally hosted version to harness internal MarkdownImage component

Related Issue

Fixes third-party cookies inadvertantly being loaded from external fetches

Copy link

netlify bot commented May 23, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 2732417
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/6834b1e5f1503b0008c5123d
😎 Deploy Preview https://deploy-preview-15504--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 42 (🔴 down 13 from production)
Accessibility: 95 (🟢 up 1 from production)
Best Practices: 89 (🔴 down 10 from production)
SEO: 99 (🔴 down 1 from production)
PWA: 59 (🟢 up 1 from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the tooling 🔧 Changes related to tooling of the project label May 23, 2025
@github-actions github-actions bot added the content 🖋️ This involves copy additions or edits label May 26, 2025
@wackerow wackerow changed the title fix: prevent cookie transfer during xml fetches fix: prevent cookie transfers during external data loads May 26, 2025
@wackerow wackerow marked this pull request as ready for review May 26, 2025 23:55
Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

const response = await fetch(url)
const response = await fetch(url, {
headers: { Cookie: "", DNT: "1" }, // Empty cookie header and do-not-track
credentials: "omit", // Don't send or receive cookies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, wonder if we should apply more of this in the other fetches for external data

@pettinarip pettinarip merged commit b48f2fb into dev May 28, 2025
6 checks passed
@pettinarip pettinarip deleted the cookies branch May 28, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits tooling 🔧 Changes related to tooling of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants