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

[device/wistron] Replace os.system and remove subprocess with shell=True #12102

Closed
wants to merge 2 commits into from

Conversation

maipbui
Copy link
Contributor

@maipbui maipbui commented Sep 18, 2022

Signed-off-by: maipbui maibui@microsoft.com

Why I did it

subprocess.Popen() and subprocess.run() is used with shell=True, which is very dangerous for shell injection.
os - not secure against maliciously constructed input and dangerous if used to evaluate dynamic content

How I did it

Replace os by subprocess
Remove shell=True, use shell=False

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: maipbui <maibui@microsoft.com>
Signed-off-by: maipbui <maibui@microsoft.com>
@maipbui
Copy link
Contributor Author

maipbui commented Oct 7, 2022

@WistronNetwork Could you help review and verify?

@WistronNetwork
Copy link
Contributor

@maipbui thanks for suggestion, will verify and get back to you soon.

@maipbui
Copy link
Contributor Author

maipbui commented Oct 26, 2022

@WistronNetwork could you update on your verification?

@WistronNetwork
Copy link
Contributor

@maipbui we had verified this and we'll create PR for related modification, thanks for advise.

@maipbui
Copy link
Contributor Author

maipbui commented Oct 27, 2022

@WistronNetwork is it good to merge?

@WistronNetwork
Copy link
Contributor

@maipbui we have PR for this change, please check #12110

@maipbui maipbui marked this pull request as ready for review November 30, 2022 01:48
@maipbui
Copy link
Contributor Author

maipbui commented Nov 30, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft
Copy link
Collaborator

Thanks @WistronNetwork!
Close this PR in favor of a larger PR #12110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants