Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insecure Global Token Revocation in REVOKE_REFRESH_TOKEN in src/GraphQl/Mutations/mutations.ts #3483

Closed
sancheet230 opened this issue Jan 29, 2025 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers security Security fix unapproved

Comments

@sancheet230
Copy link

Description

The REVOKE_REFRESH_TOKEN mutation lacks user scoping/authorization, enabling any authenticated user to revoke all refresh tokens, risking system-wide DoS and privilege escalation.

Reproduction Steps

Authenticate as any user.

Run:

mutation { revokeRefreshTokenForUser }  

Result: All users are logged out.

Impact

DoS: Disrupts all active sessions.

Security: Non-admins can revoke admin sessions.

Compliance: Unauthorized session termination violates GDPR/CCPA.

Proposed Fix

Add a userId: ID! argument to target specific users.

Enforce authorization: Allow only admins or the user themselves to revoke tokens.

Backend validation:

if (!isAdmin && currentUser.id !== userId) throw Error("Unauthorized");  

P0: Requires immediate patch to prevent exploitation.

Potential internship candidates

Please read this if you are planning to apply for a Palisadoes Foundation internship

@sancheet230 sancheet230 added the bug Something isn't working label Jan 29, 2025
@github-actions github-actions bot added security Security fix unapproved good first issue Good for newcomers labels Jan 29, 2025
@sancheet230
Copy link
Author

sancheet230 commented Jan 29, 2025

@palisadoes @Cioppolo14 I have already solved this on my local so you can assign me I will deal with it and soon will open a PR

@palisadoes
Copy link
Contributor

Closing. The API doesn't use refresh tokens

@palisadoes palisadoes closed this as not planned Won't fix, can't repro, duplicate, stale Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers security Security fix unapproved
Projects
None yet
Development

No branches or pull requests

2 participants