Skip to content

ECSoC_2026 & ELUSoC_2026 Fix: Sensitive Tokens Leaked in Login JSON Response #202

Description

@Sairaj2033

Bug Description

The login handler returns both the token (JWT) and refreshToken as top-level fields in the JSON response body[cite: 1].

Because both of these tokens are already set as httpOnly cookies, returning them in the JSON body completely defeats the httpOnly protection[cite: 1]. This makes the session vulnerable to cross-site scripting (XSS) attacks, as JavaScript on the page can easily read the raw tokens[cite: 1].

Location & Severity

  • File: controllers/Authcontroller.js (Lines 226–228)[cite: 1]
  • Severity: High[cite: 1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions