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

utils: fixed shell vulnerability in mkrest.py #3451

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

jadenabrams100
Copy link
Contributor

I found a vulnerability in this mkrest.py utilities file, where malformed input in the src_file variable could give an attacker a shell if they escaped the rest of the command. This fix restructures the Popen call to not use shell=True while still retaining the same functionality.

@github-actions github-actions bot added the Python Related code is in Python label Feb 25, 2024
echoix
echoix previously approved these changes Feb 25, 2024
utils/mkrest.py Outdated Show resolved Hide resolved
@echoix
Copy link
Member

echoix commented Feb 25, 2024

Thanks for your contribution and taking the time to make a clean PR for this!

@echoix
Copy link
Member

echoix commented Feb 25, 2024

It will just need to run black to fix the formatting error as shown in the linter logs. In case you already ran black, note that we haven't updated yet to the 2024 style, just by lack of bandwidth to update the code base beforehand.

@jadenabrams100
Copy link
Contributor Author

It will just need to run black to fix the formatting error as shown in the linter logs. In case you already ran black, note that we haven't updated yet to the 2024 style, just by lack of bandwidth to update the code base beforehand.

My apologies, I not have pre-commit set up when I made my changes and linting escaped my mind. I have fixed the formatting and added the commit to this PR!

@echoix echoix enabled auto-merge (squash) February 26, 2024 04:59
@echoix echoix merged commit 24365e1 into OSGeo:main Feb 26, 2024
26 checks passed
@neteler neteler added this to the 8.4.0 milestone Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants