You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
import_into writes to attacker-controlled paths outside the store root #18
import_into builds the target path as store.root / str(entry[KEY_PATH]) and writes
to it without validating that the result stays within the store root. A crafted export
file with "path": "../../etc/cron.d/malicious" escapes the store directory via pathlib.Path's .. traversal. pathlib.Path("store") / "../../etc/x" resolves to /etc/x on the filesystem.
mem import is the documented migration path between stores. An operator who imports
an untrusted export file can have arbitrary files written anywhere the process has
write permission. The fix is to resolve the target and verify target.resolve().is_relative_to(store.root.resolve())
before writing.
I think this one can be closed: it was fixed by #15 ("refuse path traversal in import_into", merged 2026-09-23). That PR didn't reference this issue, so it stayed open.
I checked on current main (243868db). import_into now resolves the target and refuses anything outside store.root. The payload from this report ("path": "../../escape.txt") raises ValueError: path traversal refused: ../../escape.txt, and no file is written outside the store.
Activity
PatrickSun93 commentedon Oct 1, 2026
I think this one can be closed: it was fixed by #15 ("refuse path traversal in import_into", merged 2026-09-23). That PR didn't reference this issue, so it stayed open.
I checked on current
main(243868db).import_intonow resolves the target and refuses anything outsidestore.root. The payload from this report ("path": "../../escape.txt") raisesValueError: path traversal refused: ../../escape.txt, and no file is written outside the store.