Skip to content

Commit 984cd64

Browse files
volneidevin-ai-integration[bot]emrysal
authored
test: add routing-forms tests (calcom#25044)
* test: Add comprehensive security tests for routing forms vulnerability Add comprehensive test coverage for the getIncompleteBookingSettings handler vulnerability and ensure entityPrismaWhereClause changes won't break functionality. Tests added: 1. getIncompleteBookingSettings.handler.test.ts (15 tests) - Authorization tests for personal and team forms - Credential sanitization tests (key field should never be exposed) - Organization hierarchy tests (parent org credentials) - App filtering tests (only enabled apps) - Edge cases (no credentials, form not found, etc.) 2. entityPrismaWhereClause.integration.test.ts (13 tests) - Verifies formQuery, deleteForm, and forms handlers properly scope queries - Ensures accepted membership is required for team access - Validates consistent entityPrismaWhereClause usage across handlers - Prevents regressions when adding role-based filtering Expected Test Failures: The getIncompleteBookingSettings tests currently have 4 expected failures that document the existing vulnerability: - 2 authorization tests fail (handler doesn't check user access) - 2 sanitization tests fail (handler leaks the 'key' field with OAuth tokens) These failures prove the vulnerability exists and document the secure behavior that should be implemented. Test Results: - All 13 entityPrismaWhereClause integration tests pass - All 18 existing routing-forms test files pass (156 tests) - 4 security tests fail as expected (documenting the vulnerability) The tests ensure that: 1. Fixing the vulnerability by adding entityPrismaWhereClause won't break other handlers 2. The key field is never returned in credentials 3. Only authorized users can access forms 4. Team membership requires accepted: true 5. Organization hierarchy is properly handled Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com> * Add suggested fix * Add suggested fix * fix: enforce authorization scoping and credential sanitization in routing-forms handler Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com> * Fix types --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Alex van Andel <me@alexvanandel.com>
1 parent db8c794 commit 984cd64

3 files changed

Lines changed: 1044 additions & 5 deletions

File tree

0 commit comments

Comments
 (0)