Skip to content

Commit 4855c68

Browse files
waleedlatif1claude
andcommitted
fix(confluence): use validatePathSegment for Atlassian account IDs
validateAlphanumericId rejects valid Atlassian account IDs that contain colons (e.g. 557058:6b9c9931-4693-49c1-8b3a-931f1af98134). Use validatePathSegment with a custom pattern allowing colons instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9b3ac77 commit 4855c68

File tree

1 file changed

+7
-2
lines changed
  • apps/sim/app/api/tools/confluence/user

1 file changed

+7
-2
lines changed

apps/sim/app/api/tools/confluence/user/route.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createLogger } from '@sim/logger'
22
import { type NextRequest, NextResponse } from 'next/server'
33
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
4-
import { validateAlphanumericId, validateJiraCloudId } from '@/lib/core/security/input-validation'
4+
import { validateJiraCloudId, validatePathSegment } from '@/lib/core/security/input-validation'
55
import { getConfluenceCloudId } from '@/tools/confluence/utils'
66

77
const logger = createLogger('ConfluenceUserAPI')
@@ -34,7 +34,12 @@ export async function POST(request: NextRequest) {
3434
return NextResponse.json({ error: 'Account ID is required' }, { status: 400 })
3535
}
3636

37-
const accountIdValidation = validateAlphanumericId(accountId, 'accountId', 255)
37+
// Atlassian account IDs use format like 557058:6b9c9931-4693-49c1-8b3a-931f1af98134
38+
const accountIdValidation = validatePathSegment(accountId, {
39+
paramName: 'accountId',
40+
maxLength: 255,
41+
customPattern: /^[a-zA-Z0-9:\-]+$/,
42+
})
3843
if (!accountIdValidation.isValid) {
3944
return NextResponse.json({ error: accountIdValidation.error }, { status: 400 })
4045
}

0 commit comments

Comments
 (0)