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

Malicious archives may cause problems #8

Open
kbrint opened this issue Sep 30, 2012 · 0 comments
Open

Malicious archives may cause problems #8

kbrint opened this issue Sep 30, 2012 · 0 comments

Comments

@kbrint
Copy link
Contributor

kbrint commented Sep 30, 2012

Leading / is prohibited, but an archive containing this file could cause problems on extract:

../../../../../../../../../../../../Users/you/.ssh/authorized_keys

Or even:

dir1
dir1/somefile
dir1/dir2 
dir1/dir2/../../../../../../../../../../../../Users/you/.ssh/authorized_keys

Any path containing ".." should be prohibited just like those starting with "/"

Probably something like this... not sure if this is robust enough:

for dir := range strings.Split(path, os.PathSeparator) {
  if dir == ".." {
    barf
  }
}
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

No branches or pull requests

1 participant