Repository navigation
Commit c5b2785
Block ref injection and out-of-repo symlink reads in --base (0.5.13)
Follow-up to #50, addressing its two CodeAnt review comments, which were
resolved on the PR but whose fixes were not pushed before merge.
- --base / --base-commit refs (also reachable through the MCP
codeant_review_local tool) were interpolated into a shell command, so
"main; <cmd>" ran <cmd>, and "--output=<file>" made git write a file.
Refs are now resolved with execFile + rev-parse --verify <ref>^{commit},
leading "-" is rejected, and later git commands only see the SHA.
- Working-tree reads followed symlinks, uploading files from outside the
repo: untracked links, files under untracked symlinked directories, and
(since #50) committed links in --base mode. _readRepoFile now skips
anything whose real path is outside the repo or isn't a regular file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 8d1eb94 commit c5b2785
5 files changed
Lines changed: 142 additions & 15 deletions
File tree
- src/utils
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
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 | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
471 | 485 | | |
472 | 486 | | |
473 | 487 | | |
474 | 488 | | |
475 | 489 | | |
476 | 490 | | |
477 | | - | |
478 | | - | |
| 491 | + | |
| 492 | + | |
479 | 493 | | |
480 | 494 | | |
481 | 495 | | |
| |||
549 | 563 | | |
550 | 564 | | |
551 | 565 | | |
552 | | - | |
553 | | - | |
| 566 | + | |
554 | 567 | | |
555 | 568 | | |
556 | 569 | | |
| |||
589 | 602 | | |
590 | 603 | | |
591 | 604 | | |
592 | | - | |
593 | | - | |
| 605 | + | |
594 | 606 | | |
595 | 607 | | |
596 | 608 | | |
597 | 609 | | |
598 | 610 | | |
599 | 611 | | |
600 | 612 | | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
601 | 628 | | |
602 | 629 | | |
603 | 630 | | |
| |||
1011 | 1038 | | |
1012 | 1039 | | |
1013 | 1040 | | |
1014 | | - | |
1015 | | - | |
| 1041 | + | |
| 1042 | + | |
1016 | 1043 | | |
1017 | 1044 | | |
1018 | 1045 | | |
| |||
1069 | 1096 | | |
1070 | 1097 | | |
1071 | 1098 | | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
1075 | 1102 | | |
1076 | 1103 | | |
1077 | 1104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1137 | 1233 | | |
0 commit comments