Commit e4b8e7d
Validate submodule names before filesystem operations
<!-- agent -->
Submodule names read from .gitmodules can influence the separate Git directory
path. Reject empty names, absolute or drive-qualified names, and parent
components with either path separator.
Validate before constructing module paths and before opening or mutating
existing checkouts, so a repository initialized by an older vulnerable version
cannot bypass the guard. Validate programmatic add and rename inputs before
making changes as well.
Advisory: GHSA-hmq2-w58f-27jc
Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <codex@openai.com>1 parent 6e61b1d commit e4b8e7d
2 files changed
Lines changed: 91 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
305 | 317 | | |
306 | 318 | | |
307 | 319 | | |
308 | | - | |
| 320 | + | |
309 | 321 | | |
310 | 322 | | |
311 | 323 | | |
| |||
523 | 535 | | |
524 | 536 | | |
525 | 537 | | |
| 538 | + | |
526 | 539 | | |
527 | 540 | | |
528 | 541 | | |
| |||
771 | 784 | | |
772 | 785 | | |
773 | 786 | | |
| 787 | + | |
| 788 | + | |
774 | 789 | | |
775 | 790 | | |
776 | 791 | | |
| |||
1020 | 1035 | | |
1021 | 1036 | | |
1022 | 1037 | | |
| 1038 | + | |
1023 | 1039 | | |
1024 | 1040 | | |
1025 | 1041 | | |
| |||
1160 | 1176 | | |
1161 | 1177 | | |
1162 | 1178 | | |
| 1179 | + | |
1163 | 1180 | | |
1164 | 1181 | | |
1165 | 1182 | | |
| |||
1416 | 1433 | | |
1417 | 1434 | | |
1418 | 1435 | | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
1419 | 1439 | | |
1420 | 1440 | | |
1421 | 1441 | | |
| |||
1463 | 1483 | | |
1464 | 1484 | | |
1465 | 1485 | | |
| 1486 | + | |
1466 | 1487 | | |
1467 | 1488 | | |
1468 | 1489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
925 | 925 | | |
926 | 926 | | |
927 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
928 | 997 | | |
929 | 998 | | |
930 | 999 | | |
| |||
0 commit comments