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

Update setup.py #52944

Closed
wants to merge 1 commit into from
Closed

Update setup.py #52944

wants to merge 1 commit into from

Conversation

sb508
Copy link

@sb508 sb508 commented Apr 15, 2023

Hello, I found the use of the os. open() function in the setup.py file while using the code, which can execute system commands. When input parameters are not strictly filtered, it may lead to the execution of arbitrary system commands, forming a command injection vulnerability.

Vulnerability principle:
os. open() can execute system commands. Without properly filtering user input, if the user concatenates their input as a parameter of the system command into the command line, it can cause a vulnerability in command injection. For example, if the user inputs a parameter of "ls - l; ping 1.2.3.4", both instructions will be executed, and the user can independently control the form of the second command, which endangers system security.

Repair suggestions:
Use shlex. quote() to strictly filter the input of the function. The function's functions include adding single quotes to the outermost layer of the string to make it appear as a single entity, and using double quotes to enclose single quotes within the string to prevent it from losing its possible closure function.

@paddle-bot
Copy link

paddle-bot bot commented Apr 15, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Apr 15, 2023
@paddle-bot
Copy link

paddle-bot bot commented Apr 15, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@luotao1 luotao1 self-assigned this Apr 17, 2023
@risemeup1
Copy link
Contributor

Thank you for reporting this vulnerability. You can change the logic of python/setup.py.in synchronously,the same problem may exist . When all the CI have passed, you can ask me for approval.

@paddle-ci-bot
Copy link

paddle-ci-bot bot commented Apr 23, 2023

Sorry to inform you that b302eb2's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link
Contributor

@risemeup1 risemeup1 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 mentioned this pull request Nov 12, 2023
@luotao1 luotao1 closed this Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants