fix(tasks): return 403 instead of 500 for unauthorised submission access - #111
Closed
jmirchh75 wants to merge 1517 commits into
Closed
fix(tasks): return 403 instead of 500 for unauthorised submission access#111jmirchh75 wants to merge 1517 commits into
jmirchh75 wants to merge 1517 commits into
Conversation
Simplified condition for triggering Teams notifications.
…n-click-contract feat(notifications): add safe push notification click contract
Bumps [ruby-lsp](https://github.com/Shopify/ruby-lsp) from 0.23.13 to 0.26.9. - [Release notes](https://github.com/Shopify/ruby-lsp/releases) - [Commits](Shopify/ruby-lsp@v0.23.13...v0.26.9) --- updated-dependencies: - dependency-name: ruby-lsp dependency-version: 0.26.9 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
…er/ruby-lsp-0.26.9 chore(deps-dev): bump ruby-lsp from 0.23.13 to 0.26.9
…urce-map docs: publish PPI backend data-source and field-ownership map
…g-guide docs(notifications): add the notifications contribution guide
…s-status-authorisation fix(scorm): authorise the success status wherever it is written
…sition-403 fix(tasks): return 403 when a status transition is refused
…okup-on-asserted-identity fix(auth): match a federated assertion only on what it asserts
…en-to-subject fix(lti): bind an enrolment token to its subject and make it single use
…n-set-per-recipient-delivery-errors fix(communications): keep sending when one recipient's delivery fails
…ification-route-20260828 fix(notifications): open feedback alerts in the feedback pane
…parallel-test-workers-20260828 fix(security): resolve CodeQL alerts and parallelize API tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
submission_detailsandsubmission_filesintasks_api.rbwere correctly denying access to unauthorised callers (theauthorise?check itself was working), but the denial was returned as500 Internal Server Errorinstead of403 Forbidden. This is becauseerror!()was called without an explicit status code, so Grape fell back to its default of 500.This is not a security vulnerability — no unauthorised caller ever received submission data or files. It's a correctness issue: a 500 looks like a server crash to monitoring/alerting tools and to any client code that checks specifically for 403 to distinguish "not allowed" from "something broke."
Fix: added the explicit
403status to botherror!()calls. No other logic changed.Fixes # (no tracked issue — found while adding test coverage for these endpoints)
Type of change
How Has This Been Tested?
Added
test/api/submission_access_test.rb— 14 new tests covering both endpoints:claimed_by_unit_role_id) aren't exposed to studentsVerified before/after:
Expected: 403, Actual: 500:To reproduce:
bundle exec rails test test/api/submission_access_test.rbsubmission_detailssubmission_filesChecklist:
If you have any questions, please contact @macite or @jakerenzella.