Commit ec33867
authored
fix(security): allow symlink creation, check path escape only during file writes (#381)
- Remove strict validation during symlink creation to allow legitimate symlinks to system paths
- Keep path validation during file writes using canonicalFilePath() to resolve symbolic links
- Remove symlinkTargetIsWithinTarget function to simplify security check logic
- Fix over-blocking issue while preventing Zip Slip attacks
Before fix: lib.so -> /usr/lib/xxx was incorrectly rejected
After fix: Symlink creation succeeds, writing to system files via symlinks is blocke
Bug:https://pms.uniontech.com/bug-view-356233.html1 parent 7fc5ed3 commit ec33867
File tree
4 files changed
+11
-62
lines changed- 3rdparty
- interface
- libminizipplugin
- libzipplugin
4 files changed
+11
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
| 524 | + | |
| 525 | + | |
525 | 526 | | |
526 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
527 | 531 | | |
528 | 532 | | |
529 | 533 | | |
530 | 534 | | |
531 | 535 | | |
| 536 | + | |
532 | 537 | | |
533 | 538 | | |
534 | 539 | | |
535 | 540 | | |
536 | 541 | | |
537 | 542 | | |
538 | 543 | | |
| 544 | + | |
539 | 545 | | |
540 | 546 | | |
541 | 547 | | |
542 | 548 | | |
543 | 549 | | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | 550 | | |
579 | 551 | | |
580 | 552 | | |
| |||
583 | 555 | | |
584 | 556 | | |
585 | 557 | | |
586 | | - | |
| 558 | + | |
587 | 559 | | |
588 | 560 | | |
589 | 561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | 304 | | |
318 | 305 | | |
319 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
898 | 899 | | |
899 | | - | |
| 900 | + | |
900 | 901 | | |
901 | 902 | | |
902 | 903 | | |
| |||
956 | 957 | | |
957 | 958 | | |
958 | 959 | | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | 960 | | |
966 | 961 | | |
967 | 962 | | |
| |||
0 commit comments