Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Enterprise App
>
Enterprise Application System
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
677
Star
2K
Fork
925
IBOS开源OA协同办公管理
/
IBOS
Code
Issues
4
Pull Requests
0
Wiki
Insights
Pipelines
Service
PHPDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
The database backup has Command Injection Vulnerability
Done
#I18IIV
c0d1M4x
Opened this issue
2020-01-17 10:24
## Test environment os : windows; IBOS version : IBOS 4.5.4 OPEN ## Code analysis The backup database function is in the code file ```IBOS\system\core\utils\Database.php``` with line 228.Then it will filter some file types and some sensitive characters.  in this function,another filter some sensitive characters in line 308.  finally,the run command code was begin in line 434,and it will run in line 453  Code to execute the command in line 453 is like this.The parameter ```$dumpFile``` will input this command string. ``` `{$mysqlBin}mysqldump --force --quick {$command1} --add-drop-table {$command2} {$command3} --host="{$db['host']}" {$command5} --user="{$db['username']}" --password="{$db['password']}" "{$db['dbname']}" {$tablesstr} > {$dumpFile}`; ``` Because some characters are not filtered, it can still cause command injection. ## Vulnerability Test login in the IBOS backstage,and enter the database function.For faster execution, only one of the data tables is selected for backup operation.  then you need to open the "more",and select as follows like this.  in this filename,you can input you want to run for command,and I run ```ipconfig``` like this.  ### payload ``` 2020-01-17_exdEQ1ro&ipconfig>kkkkkk&ss ``` submit it and access url like this ```http://127.0.0.1/kkkkkk```.You can see the results after the command is executed.  ## Solution filter more sensitive characters.
## Test environment os : windows; IBOS version : IBOS 4.5.4 OPEN ## Code analysis The backup database function is in the code file ```IBOS\system\core\utils\Database.php``` with line 228.Then it will filter some file types and some sensitive characters.  in this function,another filter some sensitive characters in line 308.  finally,the run command code was begin in line 434,and it will run in line 453  Code to execute the command in line 453 is like this.The parameter ```$dumpFile``` will input this command string. ``` `{$mysqlBin}mysqldump --force --quick {$command1} --add-drop-table {$command2} {$command3} --host="{$db['host']}" {$command5} --user="{$db['username']}" --password="{$db['password']}" "{$db['dbname']}" {$tablesstr} > {$dumpFile}`; ``` Because some characters are not filtered, it can still cause command injection. ## Vulnerability Test login in the IBOS backstage,and enter the database function.For faster execution, only one of the data tables is selected for backup operation.  then you need to open the "more",and select as follows like this.  in this filename,you can input you want to run for command,and I run ```ipconfig``` like this.  ### payload ``` 2020-01-17_exdEQ1ro&ipconfig>kkkkkk&ss ``` submit it and access url like this ```http://127.0.0.1/kkkkkk```.You can see the results after the command is executed.  ## Solution filter more sensitive characters.
Comments (
0
)
Sign in
to comment
Status
Done
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (9)
Tags (8)
master
fix/20250121
hotfix/fix-bug-master
hotfix/fix-bug
hotfix/update-patch
hotfix/fix-mobile
featrue/update-4.5.4
feature/tag-open-4.4.2
develop
V4.4.2
4.2.2
4.2
3.9
3.8
3.5
v3.5
3.3
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(1)
PHP
1
https://gitee.com/ibos/IBOS.git
git@gitee.com:ibos/IBOS.git
ibos
IBOS
IBOS
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register