@@ -13,6 +13,8 @@ pnpm dev # Start dev server with hot reload
1313pnpm build # Production build (runs vue-tsc first)
1414pnpm test # Run all tests once
1515pnpm test:watch # Run tests in watch mode
16+ pnpm lint # Run ESLint (includes security rules)
17+ pnpm audit:check # Scan dependencies for vulnerabilities
1618```
1719
1820** Loading the extension in Chrome:**
@@ -122,6 +124,39 @@ pnpm build # Type check + build
122124pnpm lint :fix # Auto - fix lint issues
123125pnpm format # Auto - fix formatting
124126pnpm test # Run tests
127+ pnpm audit :check # Check for vulnerable dependencies
125128```
126129
127130Fix any errors before considering the implementation complete.
131+
132+ ## Security
133+
134+ ### Security Tooling
135+
136+ The project uses three layers of security scanning:
137+
138+ 1 . ** eslint-plugin-security** - Integrated into ESLint, runs on every ` pnpm lint `
139+ - Detects eval, non-literal RegExp, child_process usage, unsafe regex patterns
140+ - ` detect-object-injection ` disabled (too many false positives with TS)
141+
142+ 2 . ** pnpm audit** - Dependency vulnerability scanning via ` pnpm audit:check `
143+ - Fails on moderate+ severity vulnerabilities
144+ - Run before releases or when updating dependencies
145+
146+ 3 . ** Semgrep** - SAST in GitHub Actions CI (` .github/workflows/security.yml ` )
147+ - Runs on push/PR to main
148+ - Uses ` auto ` , ` p/javascript ` , ` p/typescript ` rulesets
149+ - Two rules excluded as false positives (see workflow comments)
150+
151+ ### Security Patterns in Codebase
152+
153+ - ** Origin validation** : ` src/background/index.ts ` validates content script origins against ` ALLOWED_CONTENT_SCRIPT_ORIGINS `
154+ - ** Input validation** : ` src/shared/validation.ts ` sanitizes all user inputs
155+ - ** Secure storage** : API keys in ` chrome.storage.local ` , never in sync storage or exposed to content scripts
156+ - ** No dynamic code** : ESLint blocks eval/Function patterns
157+
158+ ### Running Semgrep Locally
159+
160+ ``` bash
161+ docker run --rm -v " $( pwd) :/src" semgrep/semgrep semgrep scan --config auto --config p/javascript --config p/typescript /src
162+ ```
0 commit comments