Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tar path traversal through symlinks #1

Merged
merged 2 commits into from
Jan 31, 2024
Merged

Conversation

wagoodman
Copy link

@wagoodman wagoodman commented Jan 31, 2024

There are already protections in place to prevent writing files outside of the unarchive directory. This PR extends these protections to include symlink destinations; if a symlink points to a location outside of the unarchive destination then this will now result in an error. This covers two cases:

  • when there is symlink destination that is a relative path pointing outside of the unarchive destination
  • when there is symlink destination that is an absolute path existing outside of the unarchive destination

This patches CVE-2024-0406.

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman force-pushed the fix-tar-path-traversal branch from 3393692 to a846133 Compare January 31, 2024 14:29
@wagoodman wagoodman changed the base branch from master to v3 January 31, 2024 14:30
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman merged commit 82ca88a into v3 Jan 31, 2024
1 check passed
@wagoodman wagoodman deleted the fix-tar-path-traversal branch January 31, 2024 15:41
@wagoodman wagoodman added the security related to vulnerability remediation label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security related to vulnerability remediation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants