-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
TarFile fails to extract even when symbolic link references into the output directory #77303
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsI already have an open issue about TarFile not wanting to create symbolic links that point outside the output directory: #74140. Triggered by #77096, I was curious to see if I did:
The resulting archive fails to extract:
The symbolic link it considers problematic is actually still pointing inside the output directory.
cc @carlossanlop @jozkee @am11
|
This is a duplicate of #74140, right? |
In that case, the symbolic link points outside the output directory. |
Ok, I see. It is a bug where we fail to recognize that symlink is in fact pointing to path inside the destination directory ( |
Untested, but I think:
should be: linkTargetPath = GetSanitizedFullPath(fileDestinationPath, LinkName); or linkTargetPath = GetSanitizedFullPath(Path.GetDirectoryName(fileDestinationPath), LinkName);
|
I already have an open issue about TarFile not wanting to create symbolic links that point outside the output directory: #74140.
Triggered by #77096, I was curious to see if
podman
would have the same issue asdocker
.I did:
The resulting archive fails to extract:
The symbolic link it considers problematic is actually still pointing inside the output directory.
These are the archive entries:
cc @carlossanlop @jozkee @am11
The text was updated successfully, but these errors were encountered: