Skip to content

Fix #4414: Reject invalid submission file types#5093

Open
officialasishkumar wants to merge 1 commit into
Cloud-CV:masterfrom
officialasishkumar:fix/submission-file-type-validation
Open

Fix #4414: Reject invalid submission file types#5093
officialasishkumar wants to merge 1 commit into
Cloud-CV:masterfrom
officialasishkumar:fix/submission-file-type-validation

Conversation

@officialasishkumar
Copy link
Copy Markdown

Fixes #4414.

Summary:

  • Reject uploaded submission files when their extension is not allowed by the challenge phase.
  • Apply the same extension validation to file_url submissions after URL validation and before queueing evaluation work.
  • Normalize configured file extensions and check URL paths so query strings do not affect validation.

Validation:

  • git diff --check
  • black --check apps/jobs/views.py tests/unit/jobs/test_views.py
  • isort --check-only apps/jobs/views.py tests/unit/jobs/test_views.py
  • docker compose run django pytest tests/unit/jobs/test_views.py::BaseAPITestClass::test_challenge_submission_rejects_disallowed_upload_file_type tests/unit/jobs/test_views.py::BaseAPITestClass::test_challenge_submission_rejects_disallowed_file_url_type

Reject uploaded files and file_url submissions whose extension is not allowed by the challenge phase so invalid artifacts are not queued for evaluation.
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

Successfully merging this pull request may close these issues.

[Enhancement]: Accepting files of incorrect formats instead of rejecting them

1 participant