Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

fix: #65#issuecomment-395988244 - zip slip by symlink #70

Closed
wants to merge 1 commit into from

Conversation

aviadatsnyk
Copy link
Contributor

proposed fix for #65 (comment)

@@ -8,6 +8,8 @@ import (
"path/filepath"
"runtime"
"strings"

"github.com/cyphar/filepath-securejoin"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of introducing a whole dependency just for one function... is the logic something we can extract from it pretty easily?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't be too hard, I guess. It's 135 loc including comments and whitespaces - https://github.com/cyphar/filepath-securejoin/blob/master/join.go
I would, however, consider using the lib since it's not as simple a task as it seems. (it's the only thing it's doing, btw, so we get almost no unnecessary code).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump @mholt

@mholt
Copy link
Owner

mholt commented Aug 18, 2018

@aviadatsnyk If you can resolve the conflict I'll merge this in. Thanks!

@mholt
Copy link
Owner

mholt commented Sep 20, 2018

Hmm. The issue that linked above makes some good points about how SecureJoin still isn't a secure solution, if an attacker wins a race against you.

Maybe we should just change the scope of this lib's threat model to assume that you already trust the archive file. Perhaps a better approach would be to try to detect a likely attack before extracting an archive?

(At the moment, I'm being held up because of the "zip slip" fix even though it doesn't actually solve the problem, and is hindering me from working with a trustworthy archive that is not attacking my system.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants