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

PR #356 added insecure use of tmp files #358

Closed
pawal opened this issue Jan 12, 2018 · 3 comments
Closed

PR #356 added insecure use of tmp files #358

pawal opened this issue Jan 12, 2018 · 3 comments
Assignees

Comments

@pawal
Copy link
Contributor

pawal commented Jan 12, 2018

This is a severe security issue.
See more here:
https://security.stackexchange.com/questions/34397/how-can-an-attacker-use-a-fake-temp-file-to-compromise-a-program

@mattias-p
Copy link
Member

mattias-p commented Jan 12, 2018

Discussion started here: #356 (review)

So the issue is the known filename under a world writable directory, correct? Piping the file from wget to apt-key instead of employing a temporary file would fix the issue. Did you have some other fix in mind?

@pawal
Copy link
Contributor Author

pawal commented Jan 12, 2018

Yes.

There are two writes to /tmp in PR #356:

  1. wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm -O /tmp/mysql-community-release-el7-5.noarch.rpm
  2. wget https://www.postgresql.org/media/keys/ACCC4CF8.asc -O /tmp/ACCC4CF8.asc

If you can do pipe, that is much better. You can also randomize file names, if pipe does not work.

@mattias-p
Copy link
Member

Fixed by #359

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

2 participants