Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复插件shell命令注入漏洞 #1316

Merged
merged 3 commits into from
Jan 8, 2022
Merged

修复插件shell命令注入漏洞 #1316

merged 3 commits into from
Jan 8, 2022

Conversation

nick2wang
Copy link
Collaborator

@nick2wang nick2wang commented Jan 5, 2022

相关issue:后端RCE

之前参数注入漏洞已经修复过,但是用同样的方法可以通过配置各个插件的path或实例信息来注入自定义命令

  1. 比如在soar路径里注入:
    image

补充:
2. 或在实例信息中注入:
image

影响范围:
soar
binglog2sql
sqladvisor
binlog
instance

修复:
与参数一样使用shlex.quote处理path

修复插件shell命令注入漏洞
@codecov
Copy link

codecov bot commented Jan 5, 2022

Codecov Report

Merging #1316 (7a99579) into master (f5292f4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1316   +/-   ##
=======================================
  Coverage   78.01%   78.01%           
=======================================
  Files          78       78           
  Lines       12220    12220           
=======================================
  Hits         9534     9534           
  Misses       2686     2686           
Impacted Files Coverage Δ
sql/instance.py 53.73% <ø> (ø)
sql/plugins/binglog2sql.py 100.00% <100.00%> (ø)
sql/plugins/soar.py 93.87% <100.00%> (ø)
sql/plugins/sqladvisor.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5292f4...7a99579. Read the comment docs.

LeoQuote
LeoQuote previously approved these changes Jan 5, 2022
Copy link
Collaborator

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nick2wang
Copy link
Collaborator Author

漏了通过实例信息注入的方式,待补充
image

修复插件shell命令注入漏洞 - 通过实例信息注入
hhyo
hhyo previously approved these changes Jan 5, 2022
@hhyo
Copy link
Owner

hhyo commented Jan 5, 2022

和上个pr的冲突需要解决一下

@nick2wang
Copy link
Collaborator Author

和上个pr的冲突需要解决一下

已处理

@hhyo hhyo merged commit 42e1d12 into hhyo:master Jan 8, 2022
@nick2wang nick2wang deleted the nick-patch2 branch January 10, 2022 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants