No, as in my example you can still insert \n and it causes multiple commands to be executed. We can add \n and \r to the __NOT_ALLOWED_FOR_COMMANDS__ list but maybe there are still other ways to bypass that I can't see. I was thinking about adding stricter validation in the slurm_accounts field. Maybe a regex like r"^[A-Za-z0-9._-]{3,20}$"? Which are typical slurm_accounts values?
Originally posted by @zonia3000 in #3416 (comment)
We should review whether the current command-validation function is sufficiently robust - starting with some \r or \n payload.
EDIT: To be more precise, we should review this together with the actual use case. That is, we should check how it behaves e.g. in two environments: (1) the SSH run-command, a typical subprocess.run call (e.g. with shlex.split for the argument).
We should review whether the current command-validation function is sufficiently robust - starting with some
\ror\npayload.EDIT: To be more precise, we should review this together with the actual use case. That is, we should check how it behaves e.g. in two environments: (1) the SSH run-command, a typical
subprocess.runcall (e.g. withshlex.splitfor the argument).