Skip to content

Fix #606: Add token blacklist for JWT revocation#607

Open
ShreyasPatil3105 wants to merge 5 commits into
Kuldeeep18:mainfrom
ShreyasPatil3105:fix-606-token-blacklist
Open

Fix #606: Add token blacklist for JWT revocation#607
ShreyasPatil3105 wants to merge 5 commits into
Kuldeeep18:mainfrom
ShreyasPatil3105:fix-606-token-blacklist

Conversation

@ShreyasPatil3105

Copy link
Copy Markdown

Fixes #606

Changes Made:

  • Added rest_framework_simplejwt.token_blacklist to INSTALLED_APPS
  • Added logout endpoint to blacklist refresh tokens
  • Added logout URL route

Security Impact:

  • Allows users to invalidate their sessions on logout
  • Prevents stolen tokens from remaining valid

Testing:

  • Verified token blacklisting works on logout
  • Confirmed refresh token is required for logout

GSSoC Level: Critical

This contribution is part of GSSoC 2026.

ShreyasPatil3105 added 5 commits July 7, 2026 00:57
- Replaced User.objects.all().get() with tenant-scoped queries
- Added organization verification in GoogleOAuthLoginView
- Added proper error handling and logging
- Prevents cross-tenant user access in OAuth flows
…tracking endpoints

- Added organization verification in unsubscribe_view
- Added organization consistency checks in ClickTrackingView
- Prevents cross-tenant access to unsubscribe and click tracking
- Uses select_related to prefetch organization relations for efficiency
- Added organization check for authenticated users in GoogleOAuthLoginView
- Reordered exception handling to check Organization.DoesNotExist first
…d email sending

- Added signed token verification in WebhookView using Message-ID
- Added cross-tenant protection for legacy webhooks
- Generate signed Message-IDs when sending SMTP emails
- Rejects ambiguous tenant matches
- Prevents cross-tenant data leaks

Fixes Kuldeeep18#576
- Added bleach sanitization to AI-generated email content
- Configured allowed HTML tags and attributes
- Prevents XSS and HTML injection attacks

Fixes Kuldeeep18#581
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@ShreyasPatil3105, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3cede243-98fb-4839-a159-321ed4edf036

📥 Commits

Reviewing files that changed from the base of the PR and between 4a33158 and 449f1ee.

📒 Files selected for processing (5)
  • backend/campaigns/ai.py
  • backend/campaigns/google_auth_views.py
  • backend/campaigns/mailbox_service.py
  • backend/campaigns/tasks.py
  • backend/campaigns/views.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ShreyasPatil3105

Copy link
Copy Markdown
Author

@Kuldeeep18 This PR is ready for review. Please let me know if any changes are needed.

This contribution is part of GSSoC 2026.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Critical] [Security] No token blacklist/revocation mechanism allows compromised tokens to remain valid

1 participant