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

Better quoting #465

Open
4 tasks
bcdarwin opened this issue Jun 20, 2022 · 0 comments
Open
4 tasks

Better quoting #465

bcdarwin opened this issue Jun 20, 2022 · 0 comments

Comments

@bcdarwin
Copy link
Member

Pydpiper currently suffers from a number of command injection issues. This should be considered more a reliability than a security issue since Pydpiper is meant to be run by users and not offered as a service to arbitrary users, and anyway the potential fixes (e.g. quoting via shlex.quote) may not be entirely secure.

Known parts of Pydpiper where this is an issue:

  • as of 2.0.16, we use Jinja2 templates to generate most shell commands but don't use shell escaping in the templates;
  • the flags --executor-wrapper, --command-wrapper, and --use-singularity simply generate larger bash commands, losing one level of escaping in the nested (sub)-command;
  • we hand generate single quotesto escape the square brackets in ANTs commands; this seems unreliable and it would be nice not to have to do this (although in fact it's probably unnecessary since the square brackets don't actually get (mis)-interpreted even when passed through bash)
  • flags are currently passed to executors on the command line, which seems like a hack and should probably be changed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant