Error when editing a calendar appointment returns stacktrace and query
When an authenticated user edited a calendar appointment and changed the id to one that does not exist, the server returned a 500 error containing a full stack trace and the internal SQL query. This disclosed internal file paths, class and function names, and the database query structure to the user.
- Triaged in under an hour
- Fixed in 3 months
- Disclosed after 5 months
Summary by the program
Security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-fv3c-qvjr-5rv8
The report
Summary:
After some testing in Calendar App, i found when im trying to Edit calendar appointment details and change the appointment to non-exsist id there is HTTP/1.1 500 Internal Server Error that disclose full path & internal SQL query.
Steps To Reproduce:
- login and navigate to
/nextcloud/index.php/apps/calendar/dayGridMonth/now

-
Edit Appointment and save the request
-
in the below request change
idvalue to 4 like example
Request
PUT /nextcloud/index.php/apps/calendar/v1/appointment_configs/3 HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
.
.
.
{"id":3,"token":"scjGreGCEkTQ","name":"abc","description":"","location":"","visibility":"PRIVATE","targetCalendarUri":"personal","availability":{"timezoneId":"Asia/Riyadh","slots":{"MO":[{"start":1691992800,"end":1692021600}],"TU":[{"start":1691992800,"end":1692021600}],"WE":[{"start":1691992800,"end":1692021600}],"TH":[{"start":1691992800,"end":1692021600}],"FR":[{"start":1691992800,"end":1692021600}],"SA":[],"SU":[]}},"length":300,"increment":900,"preparationDuration":0,"followupDuration":0,"timeBeforeNextSlot":0,"futureLimit":5184000,"calendarFreeBusyUris":[]}
##Resonse
HTTP/1.1 500 Internal Server Error
.
.
.
.
{
"status": "error",
"message": "Could not find a record for id",
"data": {
"type": "OCA\\Calendar\\Exception\\ClientException",
"message": "Could not find a record for id",
"code": 0,
"trace": [
{
"file": "/var/www/html/nextcloud/apps/calendar/lib/Controller/AppointmentConfigController.php",
"line": 254,
"function": "findByIdAndUser",
"class": "OCA\\Calendar\\Service\\Appointments\\AppointmentConfigService"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "update",
"class": "OCA\\Calendar\\Controller\\AppointmentConfigController"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/App.php",
"line": 183,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher"
},
{
"file": "/var/www/html/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App"
},
{
"file": "/var/www/html/nextcloud/lib/base.php",
"line": 1071,
"function": "match",
"class": "OC\\Route\\Router"
},
{
"file": "/var/www/html/nextcloud/index.php",
"line": 36,
"function": "handleRequest",
"class": "OC"
}
],
"previous": {
"type": "OCP\\AppFramework\\Db\\DoesNotExistException",
"message": "Did expect one result but found none when executing: query \"SELECT `id`, `token`, `name`, `description`, `location`, `visibility`, `user_id`, `target_calendar_uri`, `calendar_freebusy_uris`, `availability`, `start`, `end`, `length`, `increment`, `preparation_duration`, `followup_duration`, `time_before_next_slot`, `daily_max`, `future_limit` FROM `*PREFIX*calendar_appt_configs` WHERE (`id` = :dcValue1) AND (`user_id` = :dcValue2)\"; ",
"code": 0,
"trace": [
{
"file": "/var/www/html/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"line": 361,
"function": "findOneQuery",
"class": "OCP\\AppFramework\\Db\\QBMapper"
},
{
"file": "/var/www/html/nextcloud/apps/calendar/lib/Db/AppointmentConfigMapper.php",
"line": 55,
"function": "findEntity",
"class": "OCP\\AppFramework\\Db\\QBMapper"
},
{
"file": "/var/www/html/nextcloud/apps/calendar/lib/Service/Appointments/AppointmentConfigService.php",
"line": 138,
"function": "findByIdForUser",
"class": "OCA\\Calendar\\Db\\AppointmentConfigMapper"
},
{
"file": "/var/www/html/nextcloud/apps/calendar/lib/Controller/AppointmentConfigController.php",
"line": 254,
"function": "findByIdAndUser",
"class": "OCA\\Calendar\\Service\\Appointments\\AppointmentConfigService"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "update",
"class": "OCA\\Calendar\\Controller\\AppointmentConfigController"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/App.php",
"line": 183,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher"
},
{
"file": "/var/www/html/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App"
},
{
"file": "/var/www/html/nextcloud/lib/base.php",
"line": 1071,
"function": "match",
"class": "OC\\Route\\Router"
},
{
"file": "/var/www/html/nextcloud/index.php",
"line": 36,
"function": "handleRequest",
"class": "OC"
}
],
"previous": null
}
},
"code": 0
}
.

as you can see, internal paths,files functions disclosed also SQL query:
"message": "Did expect one result but found none when executing: query "SELECT id, token, name, description, location, visibility, user_id, target_calendar_uri, calendar_freebusy_uris, availability, start, end, length, increment, preparation_duration, followup_duration, time_before_next_slot, daily_max, future_limit FROM *PREFIX*calendar_appt_configs WHERE (id = :dcValue1) AND (user_id = :dcValue2)"; ",
Supporting Material/References:
https://hackerone.com/reports/1841408
Impact
internal paths & internal SQL query of the website are disclosed.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application returned a detailed debug error response (stack trace and SQL query) instead of a generic error when a lookup found no matching record.
Impact
Internal file paths, function names and the SQL query are disclosed to an authenticated user, which could aid further attacks.
What the attacker needed
An authenticated account; access to the calendar app
How it was found
- Log in and open the calendar day grid view.
- Edit an appointment and capture the save request.
- Change the id value in the request to a non-existent one and send it.
- Observe the 500 response containing the stack trace and SQL query.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A calendar feature lets you edit an appointment. If you send an edit for an appointment number that does not exist, the server crashes and shows a detailed error page. That page reveals where the code lives on the server and the database query it ran, which helps an attacker learn about the system's internals.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.