SQL-Ledger/LedgerSMB 目录遍历漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1191401 漏洞类型 路径遍历
发布时间 2007-03-07 更新时间 2007-03-07
CVE编号 CVE-2007-1329 CNNVD-ID CNNVD-200703-243
漏洞平台 N/A CVSS评分 10.0
|漏洞来源
https://www.securityfocus.com/bid/86562
https://cxsecurity.com/issue/WLB-2007030079
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200703-243
|漏洞详情
SQL-Ledger和LedgerSMB1.1.5之前版本中存在目录遍历漏洞。远程攻击者可以借助与用户和用户字符串相邻的.字符,读取和重写任意文件以及执行任意代码。这些字符串会被黑名单函数移除。黑名单函数会过滤掉这些字符串和使..字符串崩溃。
|漏洞EXP
Hi all;

Another security issue has been found in LedgerSMB < 1.1.5 and all 
versions of SQL-Ledger which allows an attacker to engage in directory 
transversal, retrieval of sensitive information, user account 
fabrication, or even arbitrary code execution.  This was fixed in 
LedgerSMB 1.1.5 and despite ample warning, the maintainer of SQL-Ledger 
has not corrected the problem.

The problem occurs because the blacklisting functions for the text 
editor strip out potentially dangerous targets rather than denying 
access when a problem is detected.  The stripping of such "dangerous" 
elements involves first stripping the $userpath (usually users) and then 
the $memberfile (by default users/members) and then opening the file 
that remains.

So, to go up two levels and open foo.txt, you could pass a url 
containing the argument of file=.users./users/members./foo.txt to the 
url for editing the template.  After these are stripped out, you are 
left with ../../foo.txt.  You can also retrieve the memberfile by using 
the path of file=useuserusers/memberssrs/members.  Then by crafting a 
similar URL or by altering the web page to post custom variables, you 
can cause the application to overwrite this file, possibly deleting or 
changing passwords, or adding user accounts.

This can also be used to cause arbitrary code to be executed as well.  
SQL-Ledger and LedgerSMB < 1.2 rely on server-writable and executable 
Perl scripts to store user preferences.  These scripts are run at every 
page load, are created on login, and destroyed at logout.  Using the 
same method, you can add arbitrary Perl code to the end of these files 
causing that to be loaded the next time the target user loads a page.

Best Wishes,
Chris Travers
begin:vcard
fn:Chris Travers
n:Travers;Chris
email;internet:chris (at) metatrontech (dot) com [email concealed]
tel;work:509-888-0220
tel;cell:509-630-7794
x-mozilla-html:FALSE
version:2.1
end:vcard
|受影响的产品
SQL-Ledger SQL-Ledger 2.6.25 LedgerSMB LedgerSMB 1.1.1
|参考资料

来源:XF
名称:sqlledger-userpathmemberfile-dir-traversal(32776)
链接:http://xforce.iss.net/xforce/xfdb/32776
来源:BUGTRAQ
名称:20070301Fulldisclosure:DirectoryTransversalandArbitraryCodeExecutionVulnerabilityinSQL-LedgerandLedgerSMB
链接:http://www.securityfocus.com/archive/1/archive/1/461630/100/0/threaded
来源:SECTRACK
名称:1017715
链接:http://securitytracker.com/id?1017715
来源:OSVDB
名称:33621
链接:http://osvdb.org/33621
来源:OSVDB
名称:33619
链接:http://osvdb.org/33619
来源:SREASON
名称:2381
链接:http://securityreason.com/securityalert/2381
来源:SECUNIA
名称:24366
链接:http://secunia.com/advisories/24366
来源:SECUNIA
名称:24363
链接:http://secunia.com/advisories/24363