-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Insecure use of /tmp #4336
Comments
Requested an CVE identifier via https://cveform.mitre.org/ |
CVE-2017-8418 has been assigned for this issue. |
Please excuse my ignorance, but what is exactly is the vulnerability? Other local users could pollute my Rubocop output with nonsense? Or is it worse than that? |
@jonas054 should have a look at this. I think he is the "cache guy" around here. 😄 |
This was submitted to oss-security -- http://www.openwall.com/lists/oss-security/2017/05/01/14 |
I think that's the extent of the problem. Anyway, I'm willing to fix it according to the suggestion from @jwilk unless anyone has any good counterarguments. |
A malicious person could pre-create directories and set write access on them so that their contents could be tampered with when RuboCop has written cache files there. We follow the recommendations of https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html to avoid these problems. A functional difference is now is that the support for translating `CacheRootDirectory: /tmp` to the system temporary directory is removed. The default CacheRootDirectory is nil (~ in YAML), which normally means $HOME/.cache, so no reason to encourage the use of /tmp.
The previous dependency can mean an insecure Rubocop version gets pulled in: rubocop/rubocop#4336 (I have _not_ validated if this changes the `ruby_version` dependency of the package. If so, we should bump the major version of logging_library to make this clear to our dependers.)
* Bump rubocop dependency The previous dependency can mean an insecure Rubocop version gets pulled in: rubocop/rubocop#4336 (I have _not_ validated if this changes the `ruby_version` dependency of the package. If so, we should bump the major version of logging_library to make this clear to our dependers.) * RuboCop = 0.50.0, TargetRubyVersion: 1.9, lint rule update, linting * Travis: skip RubyGems update, included in rvm * Gemfile: skip the pin, use the gemspec * Travis: use pre-installed Ruby 2.3.4 * Gemfile whitespace
See output `Version` vs `Solution`: ``` Name: rubocop Version: 0.51.0 Advisory: CVE-2017-8418 Criticality: Low URL: rubocop/rubocop#4336 Title: RuboCop: insecure use of /tmp Solution: upgrade to ~> 0.49.0 Vulnerabilities found! ```
Update rubocop to .49 to fix CVE-2017-8418 update rubocop to fix vuln CVE-2017-8418 rubocop/rubocop#4336
Update rubocop to .49 to fix CVE-2017-8418 update rubocop to fix vuln CVE-2017-8418 rubocop/rubocop#4336
Update rubocop to .49 to fix CVE-2017-8418 update rubocop to fix vuln CVE-2017-8418 rubocop/rubocop#4336
Actual behavior
RuboCop uses
/tmp
to store cache files insecurely.Malicious local users could exploit this to tamper with cache files belonging to other users.
Expected behavior
RuboCop should not abuse
/tmp
for cache.Please consider adopting XDG Base Directory Specification, which says cache should be stored in
$XDG_CACHE_HOME
or$HOME/.cache
.Steps to reproduce the problem
Proof-of-concept exploit:
RuboCop version
0.48.1 (using Parser 2.4.0.0, running on ruby 2.1.5 i386-linux-gnu)
The text was updated successfully, but these errors were encountered: