Bug 268381 (CVE-2007-4631) - CVE-2007-4631 QGit insecure temporary file usage
Summary: CVE-2007-4631 QGit insecure temporary file usage
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2007-4631
Product: Fedora
Classification: Fedora
Component: qgit
Version: 7
Hardware: All
OS: All
high
high
Target Milestone: ---
Assignee: Dan Horák
QA Contact: Fedora Extras Quality Assurance
URL: http://bugs.gentoo.org/show_bug.cgi?i...
Whiteboard: source=gentoo,reported=20070729,impac...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-08-30 18:43 UTC by Lubomir Kundrak
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version: 1.5.7-1.fc7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-09-10 16:54:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Lubomir Kundrak 2007-08-30 18:43:46 UTC
Description of problem:

Raphael Marichez of Gentoo reported an insecure temporary file usage flaw in
QGit. (see URL for original report)

The following code in dataloader.cpp is problematic:

220 bool DataLoader::doStart(SCList args, SCRef wd) {
221 
222         // ensure unique names for our DataLoader instance file
223         dataFileName = "/qgit_" + QString::number((ulong)this) + ".txt";
224         scriptFileName = "/qgit_" + QString::number((ulong)this) + ".sh";
225 
226         // create a script to redirect 'git rev-list' stdout to dataFile
227         QDir dir("/tmp"); // use a tmpfs mounted filesystem if available
228         bool foundTmpDir = (dir.exists() && dir.isReadable());
229         scriptFileName.prepend(foundTmpDir ? "/tmp" : wd);
230         dataFileName.prepend(foundTmpDir ? "/tmp" : wd);

Not only does QGit construct a predictable file name here, and doesn't check if
the files already exist, which can be leveraged into information leak or
arbitrary file overwrite in case they're symlinks, but later on executes one of
them. This is not just problem when /tmp is mounted with noexec option, but
might be exploited into arbitrary code execution under time-dependent race
condition.

With this said, please update as possible.

Additional information:

There's no CVE identifier for this issue. I will request one soon.

Version-Release number of selected component (if applicable):

qgit-1.5.6-1.fc7

Comment 1 Lubomir Kundrak 2007-09-03 16:31:08 UTC
Mitre assigne CVE-2007-4631 to this issue.

Comment 2 Fedora Update System 2007-09-10 16:54:48 UTC
qgit-1.5.7-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.