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]
Bug Description
The
loginhandler returns both thetoken(JWT) andrefreshTokenas top-level fields in the JSON response body[cite: 1].Because both of these tokens are already set as
httpOnlycookies, returning them in the JSON body completely defeats thehttpOnlyprotection[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
controllers/Authcontroller.js(Lines 226–228)[cite: 1]