You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release enhances application security with improvements to network
communication and input validation.
Changes:
- Migrate from cURL to IClientService for proper SSL handling
- Add input validation and sanitization for query parameters
- Improve data validation for numeric identifiers
- Bump version to 1.3.1
Files modified:
- lib/Controller/ConfigController.php
- lib/Service/ItopAPIService.php
- lib/Service/ProfileService.php
- appinfo/info.xml
- CHANGELOG.md
// Query UserRequest tickets where user is caller OR contact
158
209
// Note: ORDER BY in complex queries with subqueries may not work, so we sort in PHP
159
210
if ($personId) {
160
-
$userRequestQuery = "SELECT UserRequest WHERE (caller_id = '$personId' OR id IN (SELECT UserRequest JOIN lnkContactToTicket ON lnkContactToTicket.ticket_id = UserRequest.id WHERE lnkContactToTicket.contact_id = '$personId')) AND status != 'closed'";
211
+
$personId = $this->validateNumericId($personId);
212
+
$userRequestQuery = "SELECT UserRequest WHERE (caller_id = $personId OR id IN (SELECT UserRequest JOIN lnkContactToTicket ON lnkContactToTicket.ticket_id = UserRequest.id WHERE lnkContactToTicket.contact_id = $personId)) AND status != 'closed'";
161
213
} else {
162
214
// Fallback to name-based query if no person_id
163
-
$userRequestQuery = "SELECT UserRequest WHERE caller_id_friendlyname = '$fullName' AND status != 'closed'";
$userRequestQuery = "SELECT UserRequest WHERE caller_id_friendlyname = '$escapedFullName' AND status != 'closed'";
164
217
}
165
218
$userRequestParams = [
166
219
'operation' => 'core/get',
@@ -210,10 +263,11 @@ public function getUserCreatedTickets(string $userId, ?string $since = null, ?in
210
263
211
264
// Query Incident tickets where user is caller OR contact
212
265
if ($personId) {
213
-
$incidentQuery = "SELECT Incident WHERE (caller_id = '$personId' OR id IN (SELECT Incident JOIN lnkContactToTicket ON lnkContactToTicket.ticket_id = Incident.id WHERE lnkContactToTicket.contact_id = '$personId')) AND status != 'closed'";
266
+
$incidentQuery = "SELECT Incident WHERE (caller_id = $personId OR id IN (SELECT Incident JOIN lnkContactToTicket ON lnkContactToTicket.ticket_id = Incident.id WHERE lnkContactToTicket.contact_id = $personId)) AND status != 'closed'";
214
267
} else {
215
268
// Fallback to name-based query if no person_id
216
-
$incidentQuery = "SELECT Incident WHERE caller_id_friendlyname = '$fullName' AND status != 'closed'";
0 commit comments