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

Escape or reject special characters in commands to execute #1767

Merged

Conversation

ychiucco
Copy link
Collaborator

@ychiucco ychiucco commented Sep 16, 2024

closes #1646
closes #1647

Checklist before merging

  • I added an appropriate entry to CHANGELOG.md
  • I added logging to new code - if appropriate.
  • I merged main into the current branch.

Copy link

github-actions bot commented Sep 16, 2024

Benchmark comparison

GET /api/alive/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 0.9 1.0 0.90 0.0 0.0
power 0.8 1.0 0.80 0.0 0.0
dataset 0.9 1.0 0.90 0.0 0.0
project 0.9 1.0 0.90 0.0 0.0
job 0.8 1.0 0.80 0.0 0.0

GET /api/v2/dataset/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 8.8 9.1 0.97 0.6 0.6
power 405.0 403.9 1.00 389.0 389.0
dataset 159.7 160.2 1.00 145.6 145.6
project 46.0 44.9 1.02 50.9 50.9
job 29.4 29.4 1.00 35.3 35.3

GET /api/v2/job/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 5.8 5.8 1.00 2.2 2.2
power 142.1 139.1 1.02 652.0 652.0
dataset 141.1 138.6 1.02 904.8 904.8
project 49.4 48.7 1.01 283.7 283.7
job 39.0 37.8 1.03 224.8 224.8

GET /api/v2/project/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 6.3 6.3 1.00 0.1 0.1
power 6.3 6.1 1.03 0.1 0.1
dataset 6.2 7.2 0.86 0.1 0.1
project 8.1 8.4 0.96 2.3 2.3
job 6.2 6.1 1.02 0.1 0.1

GET /api/v2/workflow/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 10.5 10.3 1.02 0.8 0.8
power 26.3 25.9 1.02 27.2 27.2
dataset 18.5 18.3 1.01 15.8 15.8
project 21.2 21.3 1.00 19.9 19.9
job 10.1 9.9 1.02 0.8 0.8

POST /api/v2/project/3/dataset/413/images/query/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
dataset 152.6 150.9 1.01 275.1 275.1

GET /auth/current-user/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
vanilla 4.3 4.4 0.98 0.2 0.2
power 4.0 4.2 0.95 0.2 0.2
dataset 4.1 4.1 1.00 0.2 0.2
project 4.0 4.2 0.95 0.2 0.2
job 4.1 4.2 0.98 0.2 0.2

POST /auth/token/login/

User Time current (ms) Time main (ms) Ratio current/main Size current (Kb) Size main (Kb)
dataset 263.7 262.3 1.01 0.2 0.2

Copy link

github-actions bot commented Sep 16, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  fractal_server
  string_tools.py
  fractal_server/app/routes/api/v2
  task_collection_custom.py
  fractal_server/app/runner
  compress_folder.py
  run_subprocess.py
  fractal_server/app/runner/executors/slurm/sudo
  _subprocess_run_as_user.py
  executor.py
  fractal_server/app/runner/v1
  _common.py
  fractal_server/app/runner/v2
  runner_functions_low_level.py
  fractal_server/app/schemas
  _validators.py
  user.py
  fractal_server/app/schemas/v2
  task.py
  fractal_server/ssh
  _fabric.py
Project Total  

This report was generated by python-coverage-comment-action

@ychiucco ychiucco changed the title 1646 escape or reject special characters in user provided strings Escape or reject special characters in commands to execute Sep 16, 2024
@tcompa tcompa merged commit 494d63e into main Sep 17, 2024
20 checks passed
@tcompa tcompa deleted the 1646-escape-or-reject-special-characters-in-user-provided-strings branch September 17, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants