Skip to content

Review command validation #3417

Description

@tcompa

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions