Bug 268381 - (CVE-2007-4631) CVE-2007-4631 QGit insecure temporary file usage
CVE-2007-4631 QGit insecure temporary file usage
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: qgit (Show other bugs)
7
All All
high Severity high
: ---
: ---
Assigned To: Dan Horák
Fedora Extras Quality Assurance
http://bugs.gentoo.org/show_bug.cgi?i...
source=gentoo,reported=20070729,impac...
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-30 14:43 EDT by Lubomir Kundrak
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version: 1.5.7-1.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-10 12:54:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lubomir Kundrak 2007-08-30 14:43:46 EDT
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 12:31:08 EDT
Mitre assigne CVE-2007-4631 to this issue.
Comment 2 Fedora Update System 2007-09-10 12:54:48 EDT
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.