You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: addForum accepts client-supplied user_id as the forum topic author, allowing any authenticated user to impersonate another user #263
req.user (the verified JWT payload) is never used. Any authenticated user can supply another user's MongoDB ObjectId in user_id or user, and the forum topic will be attributed to that user. The impersonated user's name will then appear as the topic author in listForums (which populates user.name).
Steps to Reproduce
Log in as User A and obtain a valid session cookie.
Look up User B's _id (visible in any alumni directory response).
POST to /api/v1/forums with { "title": "...", "description": "...", "user_id": "<User B _id>" }.
Observe that the created topic shows User B's name as the author.
Expected Behavior
The user field on a new forum topic should always be set to req.user.id (the authenticated caller), never to a client-supplied value. The server is the authoritative source of identity.
Actual Behavior
Any authenticated user can author forum topics under any other user's identity by supplying a different user_id in the request body.
Activity
anshul23102 commentedon Jun 1, 2026
@omkarhole I would like to work on this issue. Could you please assign/ it to me? Contributing under NSoC '26.