Commit 12ac703
committed
fix: security audit - multiple bug fixes across codebase
## Comments for reviewers:
## Threat model: Local files that can only be edited by root are
## out-of-scope and considered trusted.
emerg-shutdown.c:
- Fix strtok separator mismatch in load_list(): continuation call
hardcoded "," instead of using the caller's separator, breaking
pipe-separated key alias parsing (e.g. KEY_A|KEY_B).
- Fix FIFO permissions: mkfifo() used 0777, changed to 0600 to
prevent unprivileged users from triggering emergency shutdown.
- Fix out-of-bounds read in netlink parsing: use strnlen() bounded
by remaining buffer length instead of unbounded strlen().
- Fix NULL dereference on empty --timeout= argument.
- Add missing exit(0) after kill_system() in paranoid mode.
- Fix print() writing NUL terminator to output.
permission-hardener:
- Anchor user/group existence checks to line boundaries to prevent
substring matches (e.g. 'roo' matching 'root:').
- Anchor dpkg-statoverride path lookups to prevent substring path
matches (e.g. '/usr/bin/su' matching '/usr/bin/sudo').
pam-info:
- Add PAM_USER sanity check: reject control characters and values
starting with '-' to prevent option injection into faillock.
pam_faillock_not_if_x:
- Remove set -x debug tracing from production PAM module to avoid
leaking authentication details into system logs.
build-fm-shim-backend:
- Use atomic write pattern (compile to temp file, then mv) to
prevent leaving a corrupted binary on interrupted compilation.
postinst:
- Add comments explaining that silent error handling for
permission-hardener and update-grub is by design to avoid
breaking APT.
hide-hardware-info, emerg-shutdown (shell):
- Add threat model comments documenting that root-owned config
directories are trusted.
https://claude.ai/code/session_01LvyeXrhG1t4pNmiHt7iAbi1 parent 3949bf3 commit 12ac703
8 files changed
Lines changed: 63 additions & 20 deletions
File tree
- debian
- usr
- bin
- libexec/security-misc
- src/security-misc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
190 | 193 | | |
191 | 194 | | |
192 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
193 | 199 | | |
194 | 200 | | |
195 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
598 | | - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
599 | 601 | | |
600 | 602 | | |
601 | 603 | | |
602 | 604 | | |
603 | | - | |
| 605 | + | |
604 | 606 | | |
605 | 607 | | |
606 | 608 | | |
607 | 609 | | |
608 | | - | |
| 610 | + | |
| 611 | + | |
609 | 612 | | |
610 | 613 | | |
611 | 614 | | |
| |||
614 | 617 | | |
615 | 618 | | |
616 | 619 | | |
617 | | - | |
| 620 | + | |
618 | 621 | | |
619 | 622 | | |
620 | 623 | | |
| |||
699 | 702 | | |
700 | 703 | | |
701 | 704 | | |
702 | | - | |
| 705 | + | |
703 | 706 | | |
704 | 707 | | |
705 | 708 | | |
706 | 709 | | |
707 | | - | |
| 710 | + | |
708 | 711 | | |
709 | 712 | | |
710 | 713 | | |
| |||
871 | 874 | | |
872 | 875 | | |
873 | 876 | | |
874 | | - | |
| 877 | + | |
875 | 878 | | |
876 | 879 | | |
877 | 880 | | |
878 | 881 | | |
879 | | - | |
| 882 | + | |
880 | 883 | | |
881 | 884 | | |
882 | 885 | | |
| |||
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
52 | | - | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
Lines changed: 18 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
| 280 | + | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | 288 | | |
292 | 289 | | |
293 | 290 | | |
| |||
392 | 389 | | |
393 | 390 | | |
394 | 391 | | |
395 | | - | |
| 392 | + | |
396 | 393 | | |
397 | 394 | | |
398 | 395 | | |
| |||
834 | 831 | | |
835 | 832 | | |
836 | 833 | | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
898 | 899 | | |
899 | 900 | | |
900 | 901 | | |
| |||
910 | 911 | | |
911 | 912 | | |
912 | 913 | | |
913 | | - | |
914 | | - | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
915 | 919 | | |
916 | 920 | | |
917 | 921 | | |
| |||
952 | 956 | | |
953 | 957 | | |
954 | 958 | | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
955 | 964 | | |
956 | 965 | | |
957 | 966 | | |
| |||
975 | 984 | | |
976 | 985 | | |
977 | 986 | | |
978 | | - | |
| 987 | + | |
979 | 988 | | |
980 | 989 | | |
981 | 990 | | |
| |||
0 commit comments