Skip to content

Commit 8cf988c

Browse files
committed
fix(selectors): use sanitized serviceDeskId and encode SharePoint siteId
Use serviceDeskIdValidation.sanitized instead of raw serviceDeskId in JSM request types URL. Add encodeURIComponent to SharePoint siteId to prevent URL path injection.
1 parent c644a23 commit 8cf988c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/sim/app/api/tools/jsm/selector-requesttypes/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function POST(request: Request) {
6666
}
6767

6868
const baseUrl = getJsmApiBaseUrl(cloudId)
69-
const url = `${baseUrl}/servicedesk/${serviceDeskId}/requesttype?limit=100`
69+
const url = `${baseUrl}/servicedesk/${serviceDeskIdValidation.sanitized}/requesttype?limit=100`
7070

7171
const response = await fetch(url, {
7272
method: 'GET',

apps/sim/app/api/tools/sharepoint/lists/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export async function GET(request: NextRequest) {
8989
return NextResponse.json({ error: 'Failed to obtain valid access token' }, { status: 401 })
9090
}
9191

92-
const url = `https://graph.microsoft.com/v1.0/sites/${siteId}/lists?$select=id,displayName,description,webUrl&$expand=list($select=hidden)&$top=100`
92+
const url = `https://graph.microsoft.com/v1.0/sites/${encodeURIComponent(siteId)}/lists?$select=id,displayName,description,webUrl&$expand=list($select=hidden)&$top=100`
9393

9494
const response = await fetch(url, {
9595
headers: {

0 commit comments

Comments
 (0)