author: ring04h
team:http://www.80vul.com
[该漏洞由ring04h发现并且投递,thx]
由于Discuz!的1_modcp_editpost.tpl.php里$orig[‘message’]未过滤,导致一个xss漏洞.
一 分析
在文件1_modcp_editpost.tpl.php里代码:
..... <? } elseif($action == 'editmessage') { ?> <textarea type="text" id="message_<?=$pid?>" name="message_<?=$pid?>" style="width: 80%; height: 200px; overflow: visible" ondblclick="doane(event)"><?=$orig['message']?></textarea> <p style="margin: 5px; text-align: center;"> <button type="button" value="true" class="submit" onclick="submitmessage('<?=$pid?>');this.disabled=true">提交</button> <button type="button" class="submit" onclick="ajaxget('modcp.php?action=editmessage&pid=<?=$pid?>&tid=<?=$tid?>&editmessagesubmit=yes&inajax=1&do=notupdate', 'postmessage_<?=$pid?>')">取消</button> </p> <script type="text/javascript"> ......
<?=$orig[‘message’]?>没有过滤导致xss.
进入以上的代码的有2处:
1. 1_viewthread.tpl.php里:
00278: <td class="postcontent" <? if($forum['ismoderator'] && ($thread['digest'] >= 0 || !$post['first'])) { ?> ondblclick="ajaxget('modcp.php?action=editmessage&pid=<?=$post['pid']?>&tid=<?=$post['tid']?>', 'postmessage_<?=$post['pid']?>')"<? } ?>> 00279: <div class="postinfo">
通过ondblclick事件触发ajaxget去访问.
2. /Beijing2008/forumdisplay.htm
00224: </td> 00225: <th class="$thread[folder]" {if $forum['ismoderator']} ondblclick="ajaxget('modcp.php?action=editsubject&tid=$thread[tid]', 'thread_$thread[tid]', 'specialposts');doane(event);"{/if}> 00226: <label>
同上下面的利用是用的1_viewthread.tpl.php里的方法.
二 利用
步骤:
1.发表新贴 ->帖子内容:<script>alert(document.cookie)</script>
2.对帖子有管理权限的用户”双击”讨论帖进入便捷编辑模式,将触发XSS.
三 补丁[fix]
缺
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论