Skip to content
Info disclosure Disclosed report Beginner CVE-2023-48308

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.

st0nzy Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • 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
calender-page.JPG
calender-page.JPG From the original on HackerOne
  • Edit Appointment and save the request

  • in the below request change id value 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
}
.

request.JPG
request.JPG From the original on HackerOne

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.

The original report as published on HackerOne, by st0nzy. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Log in and open the calendar day grid view.
  2. Edit an appointment and capture the save request.
  3. Change the id value in the request to a non-existent one and send it.
  4. 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.

More by st0nzy

View all

2 more disclosed reports, best first.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.