Commit 7c6291f
committed
security: fix auto-lock bypass, validate settings, gate sensitive messages
C1: Remove resetAutoLock() from ask() and getNpub — a malicious page
could poll getPublicKey() to prevent the timer from ever firing.
Timer now only resets on genuine user actions (approve, save, export).
M2: Validate autoLockMinutes against allowed values [0,5,15,30,60,90,180].
Rejects NaN, Infinity, negative, or arbitrary numbers.
H2: Stop logging plaintext private key prefixes in hasEncryptedData.
H3: Add sender validation — sensitive operations (setPassword,
removePassword, resetAllData, changePassword, setAutoLockTimeout,
setNostrAccessWhileLocked, setBlockCrossOriginFrames, backup.*,
unlock) now reject messages from content script contexts. Only
extension pages (popup, sidepanel, options) are allowed.1 parent f616dbd commit 7c6291f
3 files changed
Lines changed: 106 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
284 | 301 | | |
285 | 302 | | |
286 | 303 | | |
287 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
288 | 313 | | |
289 | 314 | | |
290 | 315 | | |
| |||
318 | 343 | | |
319 | 344 | | |
320 | 345 | | |
321 | | - | |
322 | 346 | | |
323 | 347 | | |
324 | 348 | | |
| |||
404 | 428 | | |
405 | 429 | | |
406 | 430 | | |
407 | | - | |
| 431 | + | |
408 | 432 | | |
409 | 433 | | |
410 | 434 | | |
| |||
509 | 533 | | |
510 | 534 | | |
511 | 535 | | |
512 | | - | |
513 | | - | |
514 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
515 | 545 | | |
516 | 546 | | |
517 | 547 | | |
| 548 | + | |
518 | 549 | | |
519 | 550 | | |
520 | 551 | | |
| |||
1220 | 1251 | | |
1221 | 1252 | | |
1222 | 1253 | | |
1223 | | - | |
1224 | 1254 | | |
1225 | 1255 | | |
1226 | 1256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
284 | 301 | | |
285 | 302 | | |
286 | 303 | | |
287 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
288 | 313 | | |
289 | 314 | | |
290 | 315 | | |
| |||
318 | 343 | | |
319 | 344 | | |
320 | 345 | | |
321 | | - | |
322 | 346 | | |
323 | 347 | | |
324 | 348 | | |
| |||
404 | 428 | | |
405 | 429 | | |
406 | 430 | | |
407 | | - | |
| 431 | + | |
408 | 432 | | |
409 | 433 | | |
410 | 434 | | |
| |||
509 | 533 | | |
510 | 534 | | |
511 | 535 | | |
512 | | - | |
513 | | - | |
514 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
515 | 545 | | |
516 | 546 | | |
517 | 547 | | |
| 548 | + | |
518 | 549 | | |
519 | 550 | | |
520 | 551 | | |
| |||
1220 | 1251 | | |
1221 | 1252 | | |
1222 | 1253 | | |
1223 | | - | |
1224 | 1254 | | |
1225 | 1255 | | |
1226 | 1256 | | |
| |||
0 commit comments