RPM

rpmbuild allows names and versions/releases like: ../../../

Bug #638636 reported by Jeff Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
RPM
New
Undecided
Unassigned
Fedora
Fix Released
High

Bug Description

tracker

Revision history for this message
In , seth (seth-redhat-bugs) wrote :

Description of problem:
look at this spec:
http://skvidal.fedorapeople.org/misc/foo-1.1.spec

build that spec.
note where the files end up being written/built.

cry softly into your keyboard when you think about %clean

<shudder>
so I think maybe ~, /, and .. among anything else you can think of need to be stricken from pkg name/ver/rel fields?

Revision history for this message
In , Jindrich (jindrich-redhat-bugs) wrote :

Fixed upstream.

~,/ and .. are no more permitted in NVR.

Revision history for this message
In , Panu (panu-redhat-bugs) wrote :

Fixed in rawhide now, keeping open for F10 tracking.

Revision history for this message
In , Tomas (tomas-redhat-bugs) wrote :

Removing group restriction.

Revision history for this message
In , Jeff (jeff-redhat-bugs) wrote :

FYI: the issue of wild characters in Name: was reported to a vendor-sec representative
in December and fixed @rpm5.org by adding PCRE validation patterns for all tags, not
just spot checking NVR. The issue is considerably more complex than, say,
   Name: ~;
and can be exercised by any script, not just rpmbuild, that constructs file paths
from RPM package tags.

Not that vendor-sec is worth much these days ...

Revision history for this message
In , Jeff (jeff-redhat-bugs) wrote :

Um, these issues are hardly fixed by preventing '/' and '~' and '..'.

After 30 minutes of dinking, there are (some) of the flaws I found (note
that I'm not even a professional "black hat", I'm quite sure that
additional paranoia and malice might have reduced 30 minutes
to something much less).

For starters, ~ is unnecessary when
   Name: whatever;cd;
is possible.

And there are eval contexts with '<' available that make
failing a build if/when a '/' is present pointless:

    Name: whatever;cd;cat<$SHELL>$'057'tmp$'057'myshell

Note that similar but much more serious exploits are possible
using /dev/tcp/HOSTNAME/PORT importing (and executing) a rootkit.

I suggest that you commit to permitted character sets in specific tag contents
and undertake explicit verification rather than fooling yourself with silliness like

    But you can't mention '/' or '~' or ".." in name/version/release!

instead. It really isn't __THAT__ hard to add an explicit permitted character set
in tag content like RPMTAG_NAME and RPMTAG_VERSION etc etc.

YMMV. Have fun!

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

rpm-4.6.1-1.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/rpm-4.6.1-1.fc10

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

rpm-4.6.1-1.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with
 su -c 'yum --enablerepo=updates-testing update rpm'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-5214

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

rpm-4.6.1-1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.

Jeff Johnson (n3npq)
tags: added: fedore rpmbuild
Changed in fedora:
importance: Unknown → High
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.