Commit c1822a0
security: remove sanitizeHtml in favor of CSP + hash verification (#178)
Remove the regex-based sanitizeHtml() function from documentation rendering.
CDN content is now trusted based on existing defense layers:
- CSP with nonce restricts script execution
- SHA-256 hash verification (allowlist approach) ensures content integrity
This resolves CodeQL "Incomplete multi-character sanitization" warnings
while maintaining security through defense-in-depth.
🖥️ IDE: [Cursor](https://cursor.sh)
🔌 Extension: [Claude Code](https://claude.ai/download)
Model-Raw: claude-opus-4-5-20251101
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent d250485 commit c1822a0
4 files changed
Lines changed: 38 additions & 423 deletions
File tree
- extensions/git-id-switcher
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | 171 | | |
217 | 172 | | |
218 | 173 | | |
| |||
333 | 288 | | |
334 | 289 | | |
335 | 290 | | |
336 | | - | |
337 | | - | |
| 291 | + | |
| 292 | + | |
338 | 293 | | |
339 | 294 | | |
340 | 295 | | |
| |||
0 commit comments