Bug 587843
Summary: | rpm: Default %install macro can wipe arbitrary directories | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Joel Becker <joel.becker> |
Component: | redhat-rpm-config | Assignee: | Panu Matilainen <pmatilai> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | low | ||
Version: | 11 | CC: | security-response-team |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2010-06-28 15:44:04 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: |
Description
Joel Becker
2010-05-01 02:32:22 UTC
(In reply to comment #0) > ANYONE TRICKED INTO REBUILDING A MALICIOUS SPECFILE CAN WIPE ARBITRARY > DIRECTORIES. If you are tricked into rebuilding a malicious specfile, you have bigger problems than accidental removal of some directory (think of various spec-file-author chosen commands that are run in various build steps). I fail to see the security implications here. Part of the packaging guidelines related to this: http://fedoraproject.org/wiki/Packaging/Guidelines#BuildRoot_tag Which says: "Fedora (as of F-10) does not require the presence of the BuildRoot tag in the spec and if one is defined it will be ignored." Some related discussion on the packaging list: http://lists.fedoraproject.org/pipermail/packaging/2009-May/006025.html (In reply to comment #0) > Note the second line. It's obvious why our spec file breaks - we've installed > files in RPM_BUILD_ROOT during %build, and they are erased at the start of > %install. Maybe your example in comment #0 is not a good example of what your spec file really does, as it shows all work being done in %install and hence should not be broken by pre-%install build root removal. In reverse order: Argh! Yes, I meant %build in my example. You probably figured that out. Of course it is affected by the pre-%install rm. As I stated, we can work around this, and isn't a reason for a bug report on its own. We'll either store our objects somewhere in the build tree or we'll do "mv $RPM_BUILD_ROOT $RPM_BUILD_ROOT.tmp" and then move it back in %install. I didn't know that BuildRoot was now ignored. I usually specify one for predictability and control, but my shell snippets always use $RPM_BUILD_ROOT and wouldn't notice if you had changed that behavior ;-) Clearly, if BuildRoot is ignored then the pre-%install rm cannot be tricked by it. So that concern is addressed. That said, I would guess that less than one out of every 10,000 people downloading an SRPM reads the specfile before rebuilding the sucker. Especially if they found it via rpmfind or the like. It think it is fair to consider this reality. What made me extra concerned was that this hidden rm would have surprised even people that actually did look at the specfile and verified no malicious commands existed in the shell snippets. Thankfully, the BuildRoot deprecation seems to make it safe. Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed. |