From edf81221ad1bd23b70eb150b2ceaafe1fa04dc92 Mon Sep 17 00:00:00 2001 From: dshvaika Date: Wed, 16 Sep 2026 13:27:19 +0300 Subject: [PATCH] fix(iot-hub): encode creatorId and type into the query string These were the only two of the thirteen fields interpolated raw, and creatorId is not an internal value: iot-hub-browse and the creator profile both read it straight off the route with nothing between the URL and the request, so a crafted id could close the parameter and append its own. The UUID shape is a convention here, not something this code enforces. --- .../src/app/shared/models/iot-hub/iot-hub-version.models.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/shared/models/iot-hub/iot-hub-version.models.ts b/ui-ngx/src/app/shared/models/iot-hub/iot-hub-version.models.ts index b194ab0371..a5afaea23c 100644 --- a/ui-ngx/src/app/shared/models/iot-hub/iot-hub-version.models.ts +++ b/ui-ngx/src/app/shared/models/iot-hub/iot-hub-version.models.ts @@ -156,7 +156,7 @@ export interface MpItemVersionQueryOptions { function filtersToQuery(o: MpItemVersionQueryOptions): string { let query = ''; if (o.type) { - query += `&type=${o.type}`; + query += `&type=${encodeURIComponent(o.type)}`; } if (o.types?.length) { query += o.types.map(t => `&type=${encodeURIComponent(t)}`).join(''); @@ -165,7 +165,7 @@ function filtersToQuery(o: MpItemVersionQueryOptions): string { query += `&peOnly=${o.peOnly}`; } if (o.creatorId) { - query += `&creatorId=${o.creatorId}`; + query += `&creatorId=${encodeURIComponent(o.creatorId)}`; } if (o.categories?.length) { query += o.categories.map(c => `&categories=${encodeURIComponent(c)}`).join('');