OCM notifications without sharedSecret return 500 instead of 400
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Read apps/cloud_federation_api/lib/Controller/RequestHandlerController.php, especially receiveNotification() and resolveNotificationIdentity(), to trace how the missing sharedSecret exception is handled. Find the controller tests for OCM notifications and add coverage for a request without notification.sharedSecret. Done means that request returns 400 with the validation error instead of 500, and the test passes.
Written by the indexing model from the issue text.
Description
Bug description
When signature checks are enabled (the default), RequestHandlerController::receiveNotification() resolves the sender identity first:
resolveNotificationIdentity() throws a BadRequestException when the notification has no sharedSecret:
but that try block only catches IncomingRequestException – the BadRequestException handler belongs to the next try block – so the request ends in a 500 and an uncaught exception is logged. (Embedded shares without secret are tracked in #67246.)
Steps to reproduce
Found by code reading.
- Send an OCM notification without
notification.sharedSecretto/ocm/notifications. - The response is a 500.
Expected behavior
A 400 with the validation error, covered by a test.
Nextcloud version
master
- Dominant language
- PHP
- Stars
- 37.7k
- Forks
- 5.4k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 585
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/server
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
1. to develop bug feature: tags good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
1. to develop bug feature: files feature: previews and thumbnails
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
1. to develop bug feature: dashboard
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
1. to develop bug feature: sharing
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
All issues in nextcloud/server
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
nhrrob/nhrrob-secure#35 ·
-
area/tests type/bug when/soon
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day