Skip to content

Security: External stylesheet import can weaken CSP and leak client metadata#6292

Open
tuanaiseo wants to merge 1 commit intoparca-dev:mainfrom
tuanaiseo:contribai/fix/security/external-stylesheet-import-can-weaken-cs
Open

Security: External stylesheet import can weaken CSP and leak client metadata#6292
tuanaiseo wants to merge 1 commit intoparca-dev:mainfrom
tuanaiseo:contribai/fix/security/external-stylesheet-import-can-weaken-cs

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

The CSS imports Google Fonts from a third-party origin at runtime. This introduces external network dependency and can expose user IP/user-agent/referrer metadata to the third party. In hardened deployments, this often conflicts with strict CSP and privacy requirements.

Severity: low
File: ui/packages/app/web/src/style/profile.css

Solution

Self-host required fonts and serve them from the same origin. Update CSP to restrict style-src/font-src to trusted origins only, ideally eliminating third-party font/CDN dependencies.

Changes

  • ui/packages/app/web/src/style/profile.css (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The CSS imports Google Fonts from a third-party origin at runtime. This introduces external network dependency and can expose user IP/user-agent/referrer metadata to the third party. In hardened deployments, this often conflicts with strict CSP and privacy requirements.

Affected files: profile.css

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
@tuanaiseo tuanaiseo requested a review from a team as a code owner April 2, 2026 14:04
@yomete
Copy link
Copy Markdown
Contributor

yomete commented Apr 2, 2026

Thanks for the PR!

However, this only removes the Google Fonts @import without adding the self-hosted @font-face declarations or bundling the .woff2 files. This would change the appearance of the UI since the Poppins and Roboto Mono fonts are actually used.

A complete migration would need to:

  • Bundle the relevant .woff2 files into the repo (e.g. we can do a public/fonts/ folder and put them in there)
  • Add @font-face declarations pointing to those local files
  • Then remove the Google Fonts import

Happy to review a revised PR that includes all three steps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants