π‘οΈ Sentinel: Fix JWT token leakage in error parameters#19
π‘οΈ Sentinel: Fix JWT token leakage in error parameters#19AGI-Corporation wants to merge 2 commits intomainfrom
Conversation
Removed the `token` field from `INVALID_OR_EXPIRED_JWT_TOKEN` error parameters in both `activepieces-error.ts` and `connection-key.service.ts`. This ensures that even invalid or expired JWT tokens are not echoed back to the client by the global error handler, minimizing sensitive information disclosure. - Updated `InvalidJwtTokenErrorParams` type to `Record<string, never>`. - Removed token passing in `connection-key.service.ts`. - Documented finding in `.jules/sentinel.md`. Co-authored-by: AGI-Corporation <186229839+AGI-Corporation@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (3)
π WalkthroughWalkthroughThis pull request implements a security fix that removes JWT token information from error responses to prevent sensitive token data from being exposed in error parameters and logs. The fix updates error type definitions and error handling implementations across the codebase. Changes
Estimated code review effortπ― 2 (Simple) | β±οΈ ~10 minutes Poem
π₯ Pre-merge checks | β 2 | β 1β Failed checks (1 inconclusive)
β Passed checks (2 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touches
π§ͺ Generate unit tests (beta)
π Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Removed the `token` field from `INVALID_OR_EXPIRED_JWT_TOKEN` error parameters in both `activepieces-error.ts` and `connection-key.service.ts`. This ensures that even invalid or expired JWT tokens are not echoed back to the client by the global error handler, minimizing sensitive information disclosure. - Updated `InvalidJwtTokenErrorParams` type to `Record<string, never>`. - Removed token passing in `connection-key.service.ts`. - Documented finding in `.jules/sentinel.md`. Co-authored-by: AGI-Corporation <186229839+AGI-Corporation@users.noreply.github.com>
This PR addresses a security enhancement by preventing the disclosure of JWT tokens (even if invalid or expired) in error responses.
π¨ Severity: MEDIUM (Security Enhancement)
π‘ Vulnerability
The
INVALID_OR_EXPIRED_JWT_TOKENerror was including the full JWT token in itsparamsobject. The application's globalerrorHandlerinpackages/server/api/src/app/helper/error-handler.tsserializes these parameters directly into the response body.π― Impact
Echoing back bearer tokens, even invalid ones, can provide an attacker with insights into the expected token format, structure, or content. It also leads to unnecessary exposure of tokens in logs (server-side and client-side) and through interception.
π§ Fix
packages/shared/src/lib/common/activepieces-error.tsto update theInvalidJwtTokenErrorParamstype, removing thetokenfield and replacing it with an emptyRecord<string, never>.packages/server/api/src/app/ee/connection-keys/connection-key.service.tsto stop passing the token when throwing theINVALID_OR_EXPIRED_JWT_TOKENerror..jules/sentinel.mdto prevent future occurrences.β Verification
ActivepiecesError.pnpm nx test sharedto ensure no regressions in core error handling types.git statusthat no unrelated artifacts (likepnpm-lock.yamlor build logs) are included in the submission.PR created automatically by Jules for task 9029737308741381011 started by @AGI-Corporation
Summary by CodeRabbit
Bug Fixes
Documentation