Skip to content

security: implement Content Security Policy in manifest.json - #121

Merged
Bindu2020324 merged 2 commits into
Bindu2020324:mainfrom
RUDRANSHU11:security/add-content-security-policy
Jun 26, 2026
Merged

security: implement Content Security Policy in manifest.json#121
Bindu2020324 merged 2 commits into
Bindu2020324:mainfrom
RUDRANSHU11:security/add-content-security-policy

Conversation

@RUDRANSHU11

Copy link
Copy Markdown
Contributor

🔐 Security Enhancement

The extension's manifest.json had no Content Security Policy (CSP) defined, leaving it vulnerable to script injection attacks.

✅ Changes Made

Added content_security_policy to manifest.json with:

  • script-src 'self' — only extension's own scripts allowed, no inline JS
  • object-src 'none' — blocks Flash/plugin exploits completely
  • base-uri 'none' — prevents base tag injection attacks
  • connect-src — restricts API calls to only 3 known providers (Gemini, Groq, OpenAI)
  • img-src 'self' data: — extension icons and data URIs only
  • style-src 'self' 'unsafe-inline' — required for React inline styles

🧪 Testing

  • Load unpacked extension from dist/ — works normally
  • API calls to Groq/Gemini/OpenAI still function correctly
  • No console CSP errors

@RUDRANSHU11

Copy link
Copy Markdown
Contributor Author

hello mentor just review it please let me know it will get except or not

@Bindu2020324
Bindu2020324 merged commit d7e6a36 into Bindu2020324:main Jun 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants