Skip to content

OAuth state parameter is never validated, enabling login CSRF attacks #185

Open

Description

@Ridanshi

Summary

The OAuth implementation currently generates a state parameter but never validates it during the callback flow.

This creates a login CSRF vulnerability and weakens OAuth request integrity protections required by the OAuth specification.

Additionally, the generated state uses Math.random(), which is not cryptographically secure.


Contexts

Weak state generation

Current implementation:

Math.random().toString(36).substring(2, 15)

Activity

  1. Ridanshi commented on May 19, 2026

    @Ridanshi
    ContributorAuthor

    Hi @Harxhit,
    I would like to work on this issue as part of GSSoC 2026. The issue is reproducible and I already have a minimal, isolated fix approach prepared for ownership validation in the affected card routes.
    Kindly assign this issue to me. Thank you!

  2. Harxhit commented on May 19, 2026

    @Harxhit
    Collaborator

    Hi @Harxhit, I would like to work on this issue as part of GSSoC 2026. The issue is reproducible and I already have a minimal, isolated fix approach prepared for ownership validation in the affected card routes. Kindly assign this issue to me. Thank you!

    Please wait for 24 hours, as we follow a standard assignment protocol before assigning issues. Thank you for your patience and understanding.

  3. Harxhit commented on May 20, 2026

    @Harxhit
    Collaborator

    @Ridanshi I have assigned this issue to you.

  4. github-actions commented on May 29, 2026

    @github-actions
    Contributor

    Hey @ShantKhatri (Project Admin) and @Harxhit (Maintainer),

    This issue (previously assigned to @Ridanshi) has been automatically unassigned because no linked pull request was found after the scheduled check.

    If work is in progress, please open a PR and link it to this issue to keep the assignment.

  5. Ridanshi commented on May 29, 2026

    @Ridanshi
    ContributorAuthor

    PR #390 appears to fully resolve this issue.

    The bug stemmed from endpoint selection using a stale event snapshot after a fresh capacity validation had already been performed. The PR aligns validation and registration routing around the same current capacity state, eliminating the inconsistency described in this report.

    I verified that the stale-capacity decision path identified in the issue is addressed by the changes in #390. This issue can likely be closed once the PR is merged.

  6. Pcmhacker-piro commented on May 31, 2026

    @Pcmhacker-piro
    Contributor

    Hi @Harxhit ,

    I’d be excited to work on this issue and contribute to the project. I have prior open-source contribution experience and am confident in implementing the required changes effectively.

  7. moved this from Todo to In progress in DevCardon Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions