Bug 232096 - CVE-2004-0813 SG_IO unsafe user command execution
CVE-2004-0813 SG_IO unsafe user command execution
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: cdrtools (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
public=20040730,impact=moderate,sourc...
: Security
Depends On: 133098
Blocks:
  Show dependency treegraph
 
Reported: 2007-03-13 17:06 EDT by Josh Bressers
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHSA-2007-0465
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-11 13:51:45 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)
Patch for CVE-2004-0806 (540 bytes, patch)
2007-03-15 15:01 EDT, Josh Bressers
no flags Details | Diff

  None (edit)
Description Josh Bressers 2007-03-13 17:06:55 EDT
bug 133098 describes a flaw in the way the kernel handles certain SG_IO
commands.  A user who has access to a /dev/sg file, can do scary things they
shouldn't be able to.  In RHEL3 we currently give the console user read/write
access to /dev/sg devices which are also recordable CD drives.  This is
obviously a problem.

Fixing this in the kernel will be nearly impossible given how the RHEL3 kernel
works.  We can however fix it by changing the way cdrecord works.

If we use consolehelper to launch cdrecord, the end user should notice no change
in behavior, and will allow us to control who is able to execute cdrecord as the
root user.
Comment 1 Josh Bressers 2007-03-15 15:00:45 EDT
If we set cdrecord to be setuid root, we will need to add the patch for
CVE-2004-0806, which could allow a local user to gain root privileges.  We will
also need to add a fix for bug 152462 (CVE-2005-0866).  There is a patch in the bug.

Neither of these are currently vulnerabilities, but would be if we set cdrecord
to setuid root.
Comment 2 Josh Bressers 2007-03-15 15:01:55 EDT
Created attachment 150154 [details]
Patch for CVE-2004-0806
Comment 4 Tomas Mraz 2007-03-27 09:16:59 EDT
See the original bug 133098 for patch adding PAM support to cdrecord + PAM config.
Comment 5 Tomas Mraz 2007-03-27 09:21:28 EDT
Cdrecord with the patch mentioned above can be made setuid root and only people
logged in on console will have access to it.

(Note that using consolehelper doesn't help us as it sets both euid and uid to 0.)
Comment 7 Josh Bressers 2007-03-29 12:36:25 EDT
harald, can you roll new packages with all the patches mentioned and just note
te n-v-r here.  It's likely we'll include these packges with the pam errata
given they depend on each other.
Comment 8 Harald Hoyer 2007-03-30 06:17:41 EDT
scsi-remote will not work with the pam patch anyway, if I think of it. So we may
note that this functionality is gone. And we could remove the code also.
Comment 9 Josh Bressers 2007-03-30 07:34:51 EDT
I think as long as we note this loss of functionality in the errata, removing it
is the right thing.
Comment 10 Harald Hoyer 2007-04-03 08:13:45 EDT
what about:
isoinfo
isodump
isovfy
isodebug
cdrdao
devdump
readcd
skel

Patch with pam and make them suid also?
Comment 11 Josh Bressers 2007-04-03 08:32:00 EDT
I suspect we would only need to modify these tools if they need to write to the
device no?  Can they not read from the cd device, rather than the sg device?
Comment 15 Red Hat Bugzilla 2007-06-11 13:51:45 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2007-0465.html

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