Skip to content

Fix: Path Traversal (Zip Slip) in UnpackArchive + UB in CutFirstSlash#45

Open
B4ldezhnik wants to merge 2 commits into
yandex:mainfrom
B4ldezhnik:fix/path-traversal-archiver
Open

Fix: Path Traversal (Zip Slip) in UnpackArchive + UB in CutFirstSlash#45
B4ldezhnik wants to merge 2 commits into
yandex:mainfrom
B4ldezhnik:fix/path-traversal-archiver

Conversation

@B4ldezhnik

Copy link
Copy Markdown

Fix: Path Traversal (Zip Slip) in UnpackArchive + UB in CutFirstSlash
Added SafeJoin function that lexically normalizes the path via std::filesystem::lexically_normal() and verifies the resulting path does not escape the target directory.
Also fixed undefined behavior in CutFirstSlash when archive key is empty.
Related to security report submitted to [security-report@yandex-team.ru]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants