fix: relax CSP for non-Teams SSO pages to unblock eval-dependent login#2330
fix: relax CSP for non-Teams SSO pages to unblock eval-dependent login#2330IsmaelMartinez wants to merge 3 commits intomainfrom
Conversation
#2326) Third-party SSO providers like Symantec VIP use Angular/jQuery which require eval(). With contextIsolation disabled, the shared V8 context enforces the page's CSP strictly, blocking eval and breaking login. Add 'unsafe-eval' to the script-src directive in enforcing CSP headers for non-Teams domains only, preserving Teams' own CSP unchanged. Closes #2326 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
✅ Changelog entry generated and committed to this PR: The file You can edit it directly in this PR if needed. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical login issue for users of third-party Single Sign-On (SSO) providers by selectively relaxing the Content Security Policy (CSP). The change specifically targets non-Teams domains to permit the use of Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request relaxes the Content Security Policy for non-Teams domains by adding 'unsafe-eval' to the script-src directive. This is a deliberate change to support third-party SSO providers that rely on eval(). The implementation correctly restricts this change to non-Teams domains, leaving the CSP for Teams pages untouched. I have one suggestion to improve the robustness of how the CSP string is modified, ensuring that only the script-src directive is affected.
📦 PR Build Artifacts✅ Build successful! Download artifacts: 🐧 Linuxx86_64 (434.03 MB) - Contains: .deb, .rpm, .tar.gz, .AppImage arm64 (425.25 MB) - Contains: .deb, .rpm, .tar.gz, .AppImage armv7l (403.29 MB) - Contains: .deb, .rpm, .tar.gz, .AppImage 🍎 macOSx86_64 (124.84 MB) - Contains: .dmg 🪟 Windowsx86_64 (105.41 MB) - Contains: .exe installer 📝 Note: Snap packages (.snap) are built in a separate workflow 🕐 Last updated: 2026-03-13 07:26 UTC |
📦 PR Snap Build Artifacts✅ Snap builds successful! Download artifacts: 🐧 Linux Snap Packagesx86_64 (107.27 MB) arm64 (104.18 MB) armv7l (98.41 MB) 📝 Note: Other package formats (.deb, .rpm, .AppImage, .dmg, .exe) are built in the main workflow |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|



Summary
Fixes login failure for users with third-party SSO providers (e.g. Symantec VIP) that use Angular/jQuery requiring
eval().Strips all CSP headers (
Content-Security-PolicyandContent-Security-Policy-Report-Only) from non-Teams domain responses, so third-party SSO pages aren't blocked by their own restrictive CSP when running withcontextIsolation: false. Teams domains (including MCAS proxy suffix) are explicitly excluded from any CSP modification.Root cause
The Symantec VIP login page delivers CSP via both HTTP headers and potentially
<meta>tags. WithcontextIsolation: false(our architectural choice for DOM access), the shared V8 context enforces even theContent-Security-Policy-Report-Onlypolicy as a blocking policy, causingUncaught EvalErrorin the VIP userservices script and preventing the Angular-based login UI from initializing.The initial fix (adding
'unsafe-eval'toscript-src) didn't work because the CSP is likely delivered via<meta>tags in the HTML, which HTTP header modification can't reach. Stripping all CSP headers handles the HTTP header case. A separate PR will add acontextIsolationconfig option as a guaranteed fallback.Test plan
npm run lint— passes cleanCloses #2326
🤖 Generated with Claude Code