CVE-2007-6131: Low severity redhat Fedora Core vulnerability
buttonpressed.sh in scanbuttond 0.2.3 allows local users to overwrite arbitrary files via a symlink attack on the (1) scan.pnm and (2) scan.jpg temporary files.
Other sources
Description of problem:
scanbuttond, as packaged, runs as a root owned process. Despite of that in /etc/scanbuttond/buttonpressed.sh one can find
TMPFILE="/tmp/scan.pnm" TMPJPGFILE="/tmp/scan.jpg"
Not even a need to race to guess those file names and that script, executed by scanbuttond, writes there. Security implications are obvious and 'mktemp' exists for a reason. As things stand now there is not even a feeble attempt to remove possibly existing files/links before trying to write to those.
Moreover 'cleanup' function is not trapped which means that there will be leftovers on an abnormal exit. At least something of that sort should be present
trap 'cleanup; exit' TERM INT QUIT KILL EXIT
before any of temporaries are created.
On the top of all the above it is highly doubtful that this script should be run by root as one of system services. Do you really want to try to run on a root behalf things like editcmd() { gimp $TMPFILE } or send some email with attachments? I guess that one of simple possible solutions would be to add a startup file in /etc/profile.d/ which would check for a presence of $DISPLAY (does not seem to much point of running that otherwise in general - at least without writing quite a different script) and that other instance of scanbuttond is not already running and launch that for a user. Other possibilty which comes to mind is to register a startup as one of seesions scripts.
Version-Release number of selected component (if applicable): scanbuttond-0.2.3-10.fc7
— Red Hat
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2007-6131?
CVE-2007-6131 has a high severity due to potential local privilege escalation and arbitrary file overwrite vulnerabilities.
How do I fix CVE-2007-6131?
To fix CVE-2007-6131, update to a patched version of scanbuttond or modify buttonpressed.sh to prevent symlink attacks.
What are the affected systems for CVE-2007-6131?
CVE-2007-6131 affects systems running Red Hat Fedora Core 7 with scanbuttond version 0.2.3.
Is CVE-2007-6131 remotely exploitable?
CVE-2007-6131 is not remotely exploitable as it requires local user access to execute the symlink attack.
What is a symlink attack in the context of CVE-2007-6131?
A symlink attack in CVE-2007-6131 involves creating symbolic links to redirect temporary file writes to unauthorized locations.