GHSA-9W67-HFXR-J8X9
JWT Token Expiration Ignored Allows Indefinite Session Persistence via Stolen Tokens
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-9W67-HFXR-J8X9 divulgada · CVSS 5.9 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The JWT authentication strategy sets `ignoreExpiration: true` in the passport-jwt configuration, meaning JWT tokens are never validated for expiration. While server-side session validation provides partial mitigation, sessions are automatically extended on every authenticated request, and the auth cookie has a 2-year `maxAge`. This means stolen or leaked JWT tokens remain valid effectively indefinitely as long as any party uses them periodically.
Affected Component
`server/src/modules/session/jwt/jwt.strategy.ts` line 32
Steps to Reproduce
- Deploy ToolJet and create a user account
- Log in and capture the `tj_auth_token` JWT from cookies
- Decode the JWT and note the `exp` claim
- Wait until after the `exp` time has passed
- Use the token to make an API request:
curl http://TOOLJET_HOST/api/apps \
-H 'Cookie: tj_auth_token=STOLEN_JWT_TOKEN' \
-H 'tj-workspace-id: WORKSPACE_UUID'- The request succeeds despite the token being expired, because `ignoreExpiration: true` skips the expiration check
Standalone Verification
// jwt.strategy.ts line 24-35 shows:
super({
jwtFromRequest: (request) => {
if (request.headers['tj_auth_token']) return request.headers['tj_auth_token'];
return request.cookies['tj_auth_token'];
},
ignoreExpiration: true, // <-- Tokens never expire
secretOrKey: configService.get('SECRET_KEY_BASE'),
passReqToCallback: true,
});
// Session validation (util.service.ts line 551) checks session.expiry,
// but immediately extends it on every request (line 555):
// session.expiry = this.getSessionExpiry();
// So active sessions never truly expire.
// Cookie maxAge is set to 2 years (util.service.ts line 134):
// maxAge: 1000 * 60 * 60 * 24 * 365 * 2Root Cause
- `jwt.strategy.ts` line 32: `ignoreExpiration: true` disables JWT-level expiration validation
- `util.service.ts` line 555: Session expiry is extended on every request via `session.expiry = this.getSessionExpiry()`
- `util.service.ts` line 134: Cookie `maxAge` set to 2 years (1000 * 60 * 60 * 24 * 365 * 2)
- No token rotation or refresh mechanism exists
Impact
Any JWT token leaked through XSS, log files, HTTP referer headers, SSRF responses, or other vectors provides persistent access to the victim's account. The combination of `ignoreExpiration: true`, auto-extending sessions, and 2-year cookie lifetime means a single token leak grants access for the lifetime of the account unless the user explicitly logs out (deleting the session record).
Suggested Fix
- Set `ignoreExpiration: false` in the JWT strategy
- Use short-lived JWTs (15-30 minutes) with a refresh token mechanism
- Do not auto-extend session expiry on every request; use a fixed session lifetime
- Reduce cookie maxAge to match the intended session duration
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmtooljet |
Sin parche | — | — | 0.0.1-security.1 afectada |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/ToolJet/ToolJet/security/advisories/GHSA-9w67-hfxr-j8x9Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
