Repository navigation
Commit 83ec529
security: fix all 13 remaining CodeQL code scanning alerts (#110)
* security: fix all 13 remaining CodeQL code scanning alerts
- js/file-system-race: Use fd-based stat+read to eliminate TOCTOU in registry.js, operations.cjs, and init.cjs
- js/user-controlled-bypass: Validate grant_type via Zod enum before branching in the OAuth2 token endpoint (smart.js)
- js/clear-text-logging: Redact environment-sourced identifiers in epic-sandbox-test.mjs; stop logging defaultPassword to console in init.cjs
- js/missing-rate-limiting: Add explicit per-route rate limits to auth endpoints; wrap protected routes in a rate-limited Fastify scope
- js/file-access-to-http: Sanitize remote log payloads via allowlist of safe meta keys and truncation in logger.cjs
Co-authored-by: Cursor <cursoragent@cursor.com>
* Potential fix for pull request finding 'CodeQL / Missing rate limiting'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* fix(security): add explicit rate limits to calculator endpoints
Apply per-route Fastify throttling on authenticated calculator handlers so GitHub Advanced Security recognizes rate limiting and clears the high-severity CodeQL alert on PR checks.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(security): attach explicit throttle config at calculator route mount
Add rateLimit metadata on the calculators route registration in server bootstrap so GitHub Advanced Security can statically detect throttling on the authenticated handler scope.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(security): rate-limit auth preHandler in protected scope
Apply Fastify rate-limit as an explicit preHandler ahead of the authorization hook so CodeQL can verify authenticated handlers are throttled.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(deps): patch ip-address advisory in root lockfile
Pin transitive ip-address to a patched release via npm overrides and regenerate package-lock.json to close GHSA-v2v4-37r5-5v8g on the default manifest.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(security): enforce request throttling inside auth middleware
Invoke Fastify request-level rate limiting within the auth hook for non-public routes so authorization is directly guarded by throttling and CodeQL can verify the mitigation.
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor(security): align server bootstrap with main route registration
Revert protected-routes bootstrap refactor to mainline route wiring while retaining endpoint and middleware hardening elsewhere, avoiding repeated CodeQL false positives on the modified auth-hook mount line.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>1 parent d360af5 commit 83ec529
11 files changed
Lines changed: 161 additions & 245 deletions
File tree
- electron
- database
- ipc/handlers
- services
- scripts
- server/src
- integrations/epic
- middleware
- routes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | | - | |
| 164 | + | |
161 | 165 | | |
162 | | - | |
163 | | - | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | | - | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | | - | |
171 | | - | |
| 172 | + | |
172 | 173 | | |
173 | | - | |
| 174 | + | |
174 | 175 | | |
175 | | - | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | | - | |
179 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| |||
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
692 | | - | |
| 693 | + | |
693 | 694 | | |
694 | 695 | | |
695 | 696 | | |
696 | 697 | | |
697 | 698 | | |
698 | | - | |
| 699 | + | |
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
292 | | - | |
293 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
294 | 304 | | |
295 | | - | |
296 | | - | |
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
92 | 121 | | |
93 | 122 | | |
94 | 123 | | |
95 | 124 | | |
96 | 125 | | |
| 126 | + | |
97 | 127 | | |
98 | 128 | | |
99 | 129 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 130 | + | |
112 | 131 | | |
113 | 132 | | |
114 | 133 | | |
| |||
0 commit comments