Commit 60be0f7
security: sanitize HTML in popup trusted-origins list to prevent XSS
Replace innerHTML template literal interpolation with DOM API methods
(createElement, textContent, appendChild) when rendering the trusted
origins list. The previous code interpolated the origin string directly
into HTML, allowing an attacker who injects a malicious string into the
trusted origins (e.g. <img src=x onerror="...">) to execute arbitrary
JavaScript in the popup's privileged extension context, potentially
exfiltrating the user's private key.
Co-Authored-By: claude-flow <ruv@ruv.net>1 parent b83f414 commit 60be0f7
1 file changed
Lines changed: 18 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
262 | 264 | | |
263 | | - | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
267 | 272 | | |
268 | 273 | | |
269 | 274 | | |
| |||
0 commit comments