Loading...
Loading...
Audit Chrome extensions for security issues, best practice violations, performance problems, and CWS compliance. Scans manifest, code, CSP, message handlers, storage, and dependencies.
npx skill4agent add quangpl/browser-extension-skills extension-analyzels wxt.config.ts plasmo.config.ts vite.config.ts manifest.json 2>/dev/nullpackage.jsonplasmo.config.tswxt.config.tsmanifest.json# Check MV version, permissions, host_permissions, CSP, web_accessible_resources
cat <ext>/manifest.json | jq '{manifest_version, permissions, host_permissions, content_security_policy, web_accessible_resources}'# XSS vectors
grep -rn "innerHTML\|outerHTML\|document\.write\|insertAdjacentHTML" <ext>/src --include="*.ts" --include="*.js"
# Unsafe patterns
grep -rn "eval(\|new Function(\|setTimeout.*string\|setInterval.*string" <ext>/src
# Hardcoded secrets
grep -rn "api_key\|apiKey\|secret\|password\|token" <ext>/src --include="*.ts" --include="*.js" | grep -v "\.test\." | grep -v "node_modules"
# HTTP (non-HTTPS) calls
grep -rn "http://" <ext>/src --include="*.ts" --include="*.js"
# Message handler sender validation
grep -rn "onMessage\|addListener" <ext>/src | grep -v "node_modules"
# Remote code loading
grep -rn "importScripts\|fetch.*\.js\|eval\|chrome\.scripting\.executeScript" <ext>/srcscript-src 'self'; object-src 'self'unsafe-inlineunsafe-evalhttp:cd <ext> && npm audit --json | jq '.vulnerabilities | to_entries[] | {pkg: .key, severity: .value.severity}'| Level | Criteria |
|---|---|
| Critical | RCE, data exfiltration, remote code loading, eval with untrusted input |
| High | XSS, missing sender validation, API keys in source, HTTP API calls |
| Medium | Overly broad permissions, unsafe-inline CSP, sync storage secrets |
| Low | Missing error handling, no TypeScript, console.log in production |
innerHTMLonMessage<all_urls>unsafe-inlineunsafe-evaleval()new Function()chrome.storage.syncweb_accessible_resources## Extension Audit Report: <name> v<version>
Date: <date> | MV: <2|3>
### Summary
Critical: X | High: X | Medium: X | Low: X
### Findings
#### [CRITICAL] API Key Exposed in Source
File: src/background.ts:42
Pattern: `const API_KEY = "sk-..."`
Fix: Move to environment variable or user-provided settings
Reference: references/common-vulnerabilities.md#4
...
### Passed Checks
- CSP: No unsafe-inline/eval ✓
- HTTPS: All API calls use HTTPS ✓references/security-checklist.mdreferences/best-practices-checklist.mdreferences/common-vulnerabilities.mdreferences/cws-compliance-checklist.mdextension-manifestextension-createextension-publish