Fix for CVE-2014-0012 (Insecure temp folder creation) #292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think this one slipped through the cracks somehow, but the fix for CVE-2014-1402 introduced another security issue, which was assigned CVE-2014-0012.
This PR simply delegates temporary directory creation to
tempfile.mkdtemp()
in FileSystemBytecodeCache, which does the right thing.The tests pass, but the only question I have is in regard to the intended behavior of the FilesystemBytecodeCache. Should multiple instances of a FileSystemBytecodeCache initialized without the directory argument point to the same directory? If so, I would need to modify my PR to stash the directory as a class variable (or something) to work around the issue.
Please see the following links for discussion of the issue:
http://seclists.org/oss-sec/2014/q1/73
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734956
Note that it looks like this was fixed via a similar patch in Debian, but it would be nice to have this upstream.