-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[device/quanta] Mitigation for security vulnerability #11867
Conversation
Signed-off-by: maipbui <maibui@microsoft.com>
Signed-off-by: maipbui <maibui@microsoft.com>
Signed-off-by: maipbui <maibui@microsoft.com>
def log_os_system(cmd1args, cmd2args, show): In reply to: 1231957757 In reply to: 1231957757 In reply to: 1231957757 Refers to: device/quanta/x86_64-quanta_ix1b_rglbmc-r0/plugins/psuutil.py:47 in ab31cfe. [](commit_id = ab31cfe, deletion_comment = False) |
Signed-off-by: maipbui <maibui@microsoft.com>
/AzurePipelines run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments
Signed-off-by: maipbui <maibui@microsoft.com>
Signed-off-by: maipbui <maibui@microsoft.com>
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: maipbui <maibui@microsoft.com>
This pull request fixes 2 alerts when merging b2f432b into e662008 - view on LGTM.com fixed alerts:
|
Signed-off-by: maipbui <maibui@microsoft.com>
This pull request fixes 2 alerts when merging a6453a5 into e662008 - view on LGTM.com fixed alerts:
|
Signed-off-by: maipbui <maibui@microsoft.com>
This pull request introduces 7 alerts and fixes 2 when merging ba7a4be into 1f0699f - view on LGTM.com new alerts:
fixed alerts:
|
@roberthong-qct @jonathantsai-qci Could you help review and verify? |
Hi @maipbui , thanks for the security enhancement. |
Hi @roberthong-qct, could you try install the latest sonic_py_common package first? The 'getstatusoutput_noshell_pipe' function is implemented in this PR #12065. |
@roberthong-qct could you update on your verification? |
This pull request fixes 2 alerts when merging 62c4237 into a750930 - view on LGTM.com fixed alerts:
|
_get_command_result_pipe() in component.py has a problem checking the return values of getstatusoutput_noshell_pipe() |
Signed-off-by: maipbui <maibui@microsoft.com>
Thanks @roberthong-qct ! I have fixed all issues based on your attachment. Is it good to merge? |
This pull request fixes 2 alerts when merging e521b22 into bc8ee7a - view on LGTM.com fixed alerts:
|
@maipbui Yes, relevant daemons and commands are running well. |
Signed-off-by: maipbui maibui@microsoft.com
Dependency: #12065
Why I did it
shell=True
is dangerous because this call will spawn the command using a shell processos
- not secure against maliciously constructed input and dangerous if used to evaluate dynamic content.How I did it
os
- use withsubprocess
Use
shell=False
with shell features|
operator: https://docs.python.org/2/library/subprocess.html#replacing-shell-pipelineHow to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)