Skip to content

fix(csp): allow Google Fonts in Control UI CSP header#28202

Closed
Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Glucksberg:fix/issue-23050
Closed

fix(csp): allow Google Fonts in Control UI CSP header#28202
Glucksberg wants to merge 1 commit intoopenclaw:mainfrom
Glucksberg:fix/issue-23050

Conversation

@Glucksberg
Copy link
Copy Markdown
Contributor

Summary

  • Add https://fonts.googleapis.com to the style-src CSP directive so the Control UI can load the Google Fonts stylesheet (Space Grotesk + JetBrains Mono)
  • Add https://fonts.gstatic.com to the font-src CSP directive so the browser can fetch the actual font files
  • Add test coverage for the new Google Fonts CSP allowances

Fixes #23050

Test plan

  • control-ui-csp.test.ts passes (2 tests, including new Google Fonts test)
  • control-ui.http.test.ts passes (12 tests, existing security header assertions still hold)
  • Manual: open dashboard at http://127.0.0.1:18789/?token=<token>, verify no CSP violations in console, verify hamburger menu works, verify Space Grotesk / JetBrains Mono fonts load

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Added https://fonts.googleapis.com to style-src and https://fonts.gstatic.com to font-src CSP directives to allow the Control UI to load Space Grotesk and JetBrains Mono fonts from Google Fonts CDN.

  • Appropriately scoped CSP directives (stylesheet domain in style-src, font file domain in font-src)
  • No overly permissive wildcards used
  • Comprehensive test coverage with updated existing test and new dedicated Google Fonts test
  • Well-documented with clear comments explaining the allowances

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Clean, focused change with proper CSP scoping, good test coverage, and standard industry practice for loading Google Fonts. No security concerns identified.
  • No files require special attention.

Last reviewed commit: 608e980

@vincentkoc
Copy link
Copy Markdown
Member

Thanks for the update on this.

I am closing this as superseded by #29279 to keep one active PR for this Google Fonts CSP regression.

If you see coverage missing in the new PR, call it out and I will reopen this thread.

@vincentkoc vincentkoc closed this Feb 28, 2026
@vincentkoc
Copy link
Copy Markdown
Member

Thanks for the earlier contribution.

I’m going to close this as a duplicate of #29279.
This earlier PR is preserved in the canonical history, and the same covered scope is now in the merged fix.

If this is a miss, tell me and I can reopen review right away.

@vincentkoc vincentkoc added dedupe:child Duplicate issue/PR child in dedupe cluster close:duplicate Closed as duplicate labels Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

close:duplicate Closed as duplicate dedupe:child Duplicate issue/PR child in dedupe cluster gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Dashboard CSP blocks Google Fonts, hamburger menu broken in 2026.2.21-2

2 participants