Bug 1140725
Summary: | automake: insecure use of /tmp in install-sh | ||||||
---|---|---|---|---|---|---|---|
Product: | [Other] Security Response | Reporter: | Vasyl Kaigorodov <vkaigoro> | ||||
Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> | ||||
Status: | CLOSED WONTFIX | QA Contact: | |||||
Severity: | low | Docs Contact: | |||||
Priority: | low | ||||||
Version: | unspecified | CC: | carnil, jwilk, phracek, praiskup, vkaigoro | ||||
Target Milestone: | --- | Keywords: | Security | ||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2015-08-21 23:45:29 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1140728 | ||||||
Attachments: |
|
Description
Vasyl Kaigorodov
2014-09-11 14:27:12 UTC
Created attachment 936942 [details]
Firstly create the test directory, then check for mkdir -p
Thanks for forwarding this bug report. Would attached patch resolve your
concerns? I'll forward this discussion upstream afterwards. Note that
as this is in automake from cca 2006, applying this downstream only would
result just only in unnecessary risk.
Why I think the fix should be OK:
- this is all about low prio check, if attacker is able to guess the test
directory, we simply fail the check and install-sh is not going to use
'mkdir -p' (will step-by-step directory creation)
- once $tmpdir is created, we know that nobody should be able to write to that
directory (note the $mkdir_umask) and create nasty symlinks or whatever
- using $RANDOM now should not hurt even in dash - when $RANDOM is empty (or
having some non-random value), it just increases the chance of collision
- sadly, another process (mkdir) was needed
Thanks for any comments,
Pavel
Original reporter here. The patch looks good to me, thanks! Upstream proposal: http://www.mail-archive.com/automake-patches@gnu.org/msg07704.html |