Limesoft Guestbook 'Index.PHP' 直接静态代码注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1190927 漏洞类型 输入验证
发布时间 2007-04-18 更新时间 2007-04-18
CVE编号 CVE-2007-2093 CNNVD-ID CNNVD-200704-349
漏洞平台 N/A CVSS评分 7.5
|漏洞来源
https://cxsecurity.com/issue/WLB-2007040097
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200704-349
|漏洞详情
LimesoftGuestbook(LSSimpleGuestbook)的index.php中存在直接静态代码注入漏洞。远程攻击者可以借助通讯参数,注入任意的PHP代码到posts.txt。
|漏洞EXP
########################################################
#   Special Greetings To - Timq,Warpboy,The-Maggot     #
########################################################

File: index.php
Affects: LS simple guestbook (v1)
Date: 15th April 2007

Issue Description:
========================================================================
===
LS simple guestbook fails to sanitize user input that it writes to the 
posts.txt file when the user leaves a message, this file is then included 
causing any php code within it to be run.
========================================================================
===

Scope:
========================================================================
===
An attacker can inject arbitrary php code and potentially execute commands 
on the system.
========================================================================
===

Recommendation:
========================================================================
===
Add the following line of code in index.php:

$message = strip_tags($message);

just above:

if ($message != "") {$file = fopen("$dataf","a");
========================================================================
===

Example:

name = Test
message = <?php phpinfo(); ?>

Discovered By: Gammarays
|参考资料

来源:XF
名称:lsguestbook-index-code-execution(33666)
链接:http://xforce.iss.net/xforce/xfdb/33666
来源:BID
名称:23503
链接:http://www.securityfocus.com/bid/23503
来源:BUGTRAQ
名称:20070415LSsimpleguestbook-arbitrarycodeexecution
链接:http://www.securityfocus.com/archive/1/archive/1/465864/100/0/threaded
来源:MILW0RM
名称:3735
链接:http://www.milw0rm.com/exploits/3735
来源:VUPEN
名称:ADV-2007-1393
链接:http://www.frsirt.com/english/advisories/2007/1393
来源:SECUNIA
名称:24904
链接:http://secunia.com/advisories/24904
来源:SREASON
名称:2590
链接:http://securityreason.com/securityalert/2590