-
Notifications
You must be signed in to change notification settings - Fork 519
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
Avoid the usage of shell=True
in Popen, which could lead to potential security risks.
#1435
Conversation
buildozer/targets/android.py
Outdated
@@ -569,7 +564,7 @@ def _android_update_sdk(self, *sdkmanager_commands): | |||
sdkmanager_path = self.sdkmanager_path | |||
sdk_root = f"--sdk_root={android_sdk_dir}" | |||
command = f"{yes_command} | {sdkmanager_path} {sdk_root} --licenses" | |||
self.buildozer.cmd(command, cwd=self.android_sdk_dir) | |||
self.buildozer.cmd(command, cwd=self.android_sdk_dir, shell=True) |
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.
i believe this one could be replaced using pipes to capture stdout and inject it in stdin of sdkmanager, but indeed our abstraction probably doesn't make that convenient.
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.
Yeah, that was a quick fix in order to see the CI running. I expect to remove it before the merge.
We have another shell=True
on iOS, that needs some attention, but doesn't make use of anything that is injectable by the user via buildozer.spec
, so is low-prio.
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.
Changed this one, but kept the one on iOS.
shell=True
in Popen, which could lead to potential security risks.
🏁 I think is ready for a review. |
0a31e74
to
4a14335
Compare
4a14335
to
63909c8
Compare
63909c8
to
f85a901
Compare
@tshirtman since you started a review on it, do you see anything that could lock us to merge it? |
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.
Looks good to me, didn't run it, (but tests & CI should catch any issue), and can't see anything wrong with the changes.
* Add support --res_xml option in p4a * res_xml paths are relative to buildozer.spec * Changes for NDK23 (kivy#1427) The arch no longer used in url for NDK23+ * Our self-hosted Apple Silicon runner now has been migrated to actions/runner v2.292.0 which now supports arm64 natively (kivy#1438) * use p4a --add-source instead of manual copy (kivy#1450) Currently, android.add_src does not work anymore. Using --add-source from p4a make it work again. * fix aar build (kivy#1444) * fix aar build * update default.spec to include 'debug_artifact' * Updates default buildozer.spec NDK from 19b to 23b (kivy#1462) * Update CHANGELOG and prepare release 1.4.0 (kivy#1463) * Bump version to 1.4.1.dev0 (kivy#1464) * p4a prerequisites install should be done in non-interactive mode during CI builds. (kivy#1465) * Avoid the usage of `shell=True` in Popen, which could lead to potential security risks. (kivy#1435) * Removes (where possible) the usage of shell=True in Popen * Fixes (needs check on runtime) adb + add a solution for p4a.extra_args * Change the logic to auto accept the SDK licenses, to avoid the shell=True usage * Removes six dependency in tests (kivy#1475) * Fixes some E275 - assert is a keyword. (kivy#1495) * Fix presplash color (kivy#1497) Buildozer wont build if a presplash color is set, this should fix it as descrived in kivy#1487 * Show output during aab support check, as p4a may require the user input (kivy#1494) * Update installation.rst (kivy#1500) * Update installation.rst Update jdk and Ubuntu versions. Update WSL usage instructions. * Update installation.rst * Update docs/source/installation.rst Co-authored-by: Mirko Galimberti <[email protected]> * Update docs/source/installation.rst Co-authored-by: Mirko Galimberti <[email protected]> Co-authored-by: Mirko Galimberti <[email protected]> Co-authored-by: Eero af Heurlin <[email protected]> Co-authored-by: HyTurtle <[email protected]> Co-authored-by: Mirko Galimberti <[email protected]> Co-authored-by: Mathieu Virbel <[email protected]> Co-authored-by: Mikhail Zakharov <[email protected]> Co-authored-by: Akshay Arora <[email protected]> Co-authored-by: Apacelus <[email protected]> Co-authored-by: RobertF <[email protected]>
See full story here:
#1433 (comment)
#1433 (comment)
#1433 (comment)