Skip to content

Critical (Security): /test-session endpoint accepts unsanitized mode and user fields from request body #11

@harsharajkumar

Description

@harsharajkumar

The POST /auth/test-session endpoint (auth.routes.js:249-272) stores the raw req.body.user object and an arbitrary mode string directly into the session without validating mode against an allowlist or sanitizing the user object. Any caller who can reach this endpoint (it is enabled when NODE_ENV !== 'production' or when ALLOW_TEST_SESSION_AUTH=true) can inject an arbitrary user identity and mode value into a real session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcriticalMust fix before next releasesecuritySecurity vulnerability or concern

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions