Commit c96bbe3
Reject submodule checkout paths outside the repository
GHSA-59cr-6r3x-644w identifies that submodule update paths could reach filesystem operations without the containment check already used by add and move.
Add a regression that proves update rejects a parent-directory checkout path before cloning, and override Submodule.abspath to apply the shared _to_relative_path guard for every filesystem consumer.
Git baseline: git.git read-cache.c verify_path_internal() rejects invalid index paths, covered for parent traversal by t/t9300-fast-import.sh.
Validation: .venv/bin/python -m pytest test/test_submodule.py -q; pre-commit run --files git/objects/submodule/base.py test/test_submodule.py; mypy git/objects/submodule/base.py; git diff --check.1 parent 1d47514 commit c96bbe3
2 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
417 | 422 | | |
418 | 423 | | |
419 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1369 | 1369 | | |
1370 | 1370 | | |
1371 | 1371 | | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
1372 | 1387 | | |
1373 | 1388 | | |
1374 | 1389 | | |
| |||
0 commit comments