Limit RC10 manifest traversal
GeoIntel release gates / Compile, test, contracts and builds (push) Canceled after 0s
GeoIntel release gates / Python and npm vulnerability policy (push) Canceled after 0s
GeoIntel release gates / GIS image, SBOM and container scan (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-18 07:20:36 +02:00
parent bb38d8a6a3
commit 6983ea19f1
2 changed files with 17 additions and 1 deletions
@@ -161,6 +161,18 @@ def test_referenced_tile_manifest_protects_its_tiles(tmp_path: Path) -> None:
assert tile.resolve() in expanded
def test_ordinary_json_export_is_not_treated_as_an_artifact_manifest(tmp_path: Path) -> None:
audit = load_script("audit_data_operations.py")
storage = tmp_path / "storage"
export = storage / "exports" / "project" / "report.json"
export.parent.mkdir(parents=True)
export.write_text(json.dumps({"dataset_id": "not-a-file"}), encoding="utf-8")
expanded = audit.expand_manifest_references({export.resolve()}, storage)
assert expanded == {export.resolve()}
def test_disk_pressure_uses_absolute_headroom_for_large_arrays(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,
+5 -1
View File
@@ -170,7 +170,11 @@ def expand_manifest_references(references: set[Path], storage_root: Path) -> set
root = storage_root.resolve()
expanded = set(references)
for manifest in list(references):
if manifest.suffix.lower() != ".json" or not manifest.is_file():
if (
manifest.suffix.lower() != ".json"
or "manifest" not in manifest.name.lower()
or not manifest.is_file()
):
continue
try:
if manifest.stat().st_size > 16 * 1024 * 1024: