13 of 33 API endpoints never disable display_errors — potential stack-trace leak #39

Open
opened 2026-08-31 21:29:45 -04:00 by jared · 0 comments
Owner

Severity: Medium

The following endpoints never call ini_set('display_errors', 0), relying entirely on the server's global php.ini setting: api/assign_ticket.php, api/audit_log.php, api/bulk_operation.php, api/check_duplicates.php, api/download_attachment.php, api/get_comments.php, api/get_template.php, api/get_users.php, api/health.php, api/notifications.php, api/saved_filters.php, api/user_preferences.php, api/watch_ticket.php.

The other 20 endpoints explicitly disable it. An uncaught error/warning in one of these 13 (e.g. a DB connection hiccup before any try/catch is entered) can leak a stack trace with internal file paths straight into the JSON/HTML response if the server's display_errors ini default is ever On.

Fix: Add ini_set('display_errors', 0); error_reporting(E_ALL); to the top of these 13 files, matching the pattern used everywhere else — or better, centralize this in a bootstrap include (see the related ErrorHandler.php rollout issue) so it can't be missed on new endpoints.

**Severity:** Medium The following endpoints never call `ini_set('display_errors', 0)`, relying entirely on the server's global `php.ini` setting: `api/assign_ticket.php`, `api/audit_log.php`, `api/bulk_operation.php`, `api/check_duplicates.php`, `api/download_attachment.php`, `api/get_comments.php`, `api/get_template.php`, `api/get_users.php`, `api/health.php`, `api/notifications.php`, `api/saved_filters.php`, `api/user_preferences.php`, `api/watch_ticket.php`. The other 20 endpoints explicitly disable it. An uncaught error/warning in one of these 13 (e.g. a DB connection hiccup before any try/catch is entered) can leak a stack trace with internal file paths straight into the JSON/HTML response if the server's `display_errors` ini default is ever `On`. **Fix:** Add `ini_set('display_errors', 0); error_reporting(E_ALL);` to the top of these 13 files, matching the pattern used everywhere else — or better, centralize this in a bootstrap include (see the related ErrorHandler.php rollout issue) so it can't be missed on new endpoints.
jared added the priority/mediumsecurity labels 2026-09-08 10:15:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#39