UI_LOGIN parses graphql-transport-ws as a JWT and logs invalid-token warnings

Author: Alb11747Created Sep 23, 2026Updated Sep 23, 2026
Labelsbug

Steps to reproduce

Reproduced on a fresh official Docker container, with no existing data, extensions, WebUI, or reverse proxy. Only Docker and curl are needed (commands below use a POSIX shell).

  1. Start an isolated instance with UI_LOGIN enabled. The username/password below are disposable reproduction credentials; the port is bound to loopback.
bash
docker run -d --name suwayomi-jwt-issue-repro \
  -p 127.0.0.1:14567:4567 \
  -e AUTH_MODE=UI_LOGIN \
  -e AUTH_USERNAME=repro -e AUTH_PASSWORD=ReproOnly123 \
  -e WEB_UI_ENABLED=false -e WEB_UI_UPDATE_INTERVAL=0 \
  ghcr.io/suwayomi/suwayomi-server:v2.3.2363-preview@sha256:382e5dac9924efddcc49a258be93bb173b6e1976f6a69e434f61e14acd00bf5c
  1. Wait until docker logs suwayomi-jwt-issue-repro shows Listening on http://0.0.0.0:4567/.
  2. Make a WebSocket handshake with the standard GraphQL subprotocol, without any Authorization header or cookies:
bash
curl --http1.1 -i --max-time 2 \
  -H 'Connection: Upgrade' \
  -H 'Upgrade: websocket' \
  -H 'Sec-WebSocket-Version: 13' \
  -H 'Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==' \
  -H 'Sec-WebSocket-Protocol: graphql-transport-ws' \
  http://127.0.0.1:14567/api/graphql

The WebSocket key is the public RFC example, not a credential. HTTP 101 is expected. curl then exits with code 28 because this intentionally leaves the upgraded socket idle until the two-second timeout; that timeout is not the bug.

  1. Inspect docker logs suwayomi-jwt-issue-repro: one new Received invalid token warning and JWTDecodeException appear for this connection, before any GraphQL message is sent.
  2. Control: repeat the same curl command with only the Sec-WebSocket-Protocol header removed. It still receives HTTP 101, but adds no invalid-token warning. Re-add the header and the warning returns.

Cleanup of this disposable instance: docker rm -fv suwayomi-jwt-issue-repro. Do not use a production container name.

Expected behavior

A WebSocket subprotocol name should not be parsed as a JWT. Opening a GraphQL WebSocket with graphql-transport-ws, before supplying authentication in connection_init, should not emit an invalid-token warning. Authentication must still be enforced for protected operations; this report is not asking to relax it.

Actual behavior

Every tested handshake with Sec-WebSocket-Protocol: graphql-transport-ws produces this warning:

WARN suwayomi.tachidesk.global.impl.util.Jwt -- Received invalid token
com.auth0.jwt.exceptions.JWTDecodeException: The token was expected to have 3 parts, but got 0.
    at com.auth0.jwt.TokenUtils.wrongNumberOfParts(TokenUtils.java:45)
    at com.auth0.jwt.TokenUtils.splitToken(TokenUtils.java:23)
    at com.auth0.jwt.JWTDecoder.<init>(JWTDecoder.java:37)
    at com.auth0.jwt.JWTVerifier.verify(JWTVerifier.java:451)
    at suwayomi.tachidesk.global.impl.util.Jwt.verifyJwt(Jwt.kt:90)
    at suwayomi.tachidesk.server.user.UserTypeKt.getUserFromToken(UserType.kt:51)
    at suwayomi.tachidesk.server.user.UserTypeKt.getUserFromWsContext(UserType.kt:100)
    at suwayomi.tachidesk.server.JavalinSetup.defineCore$lambda$3$0(JavalinSetup.kt:281)

On the fresh instance, the no-subprotocol control added 0 warnings; the GraphQL-subprotocol request added 1. Both returned HTTP 101. The same A/B result was reproduced with a Python standard-library socket client.

Observed impact: misleading warnings and stack traces on normal GraphQL WebSocket connections/reconnections. I have not demonstrated an authentication bypass or a failure of authenticated subscriptions.

Suwayomi-Server version

v2.3.2363-preview (official Docker image, pinned digest in reproduction)

Used database

H2

Server operating system

Ubuntu 22.04.5 LTS host; official image uses Ubuntu 24.04.4 LTS (x86_64)

Server Desktop Environment

None (headless Docker)

Server JVM version

OpenJDK Temurin 25.0.3+9-LTS

Used client name

curl; independently reproduced with Python standard-library sockets

Client version

curl 7.81.0; Python 3.10.12

Used web browser

Not applicable: no browser/WebUI required

Client operating system

Ubuntu 22.04.5 LTS (x86_64)

Other details

The likely cause is in getUserFromWsContext: it falls back from Authorization to Sec-WebSocket-Protocol, then passes the entire value to JWT verification. Thus graphql-transport-ws is treated as a token.

GraphQL already reads its actual authentication token from the connection_init payload in ApolloSubscriptionProtocolHandler.onInit. A potential fix should distinguish supported subprotocol names from any intentional token-in-subprotocol authentication, preserving existing authentication behavior.

Troubleshooting: reproduced on a fresh container/database, with no personal configuration, browser state, proxy, or extensions. Server is the latest preview available when tested (v2.3.2363, released 2026-09-23). WebUI update acknowledgement is not applicable to this reproduction: WEB_UI_ENABLED=false and no WebUI is used. Both preview changelogs were checked; this is not listed as fixed.

The issue was also observed on an existing v2.3.2356 installation, but that older version was not tested with a fresh container. The isolated reproduction above is on v2.3.2363.

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • I have checked the ongoing preview changelog of Suwayomi-WebUI and Suwayomi-Server and this bug has NOT been listed as fixed
  • I have written a short but informative title (ideally less than ~100 characters).
  • I have tried the troubleshooting guide described in README.md
  • I have updated the (Suwayomi-WebUI and Suwayomi-Server) to the latest versions
  • I have filled out all of the requested information in this form, including specific version numbers.
  • I understand that Suwayomi does not have or fix any extensions, and I will not receive help for any issues related to sources or extensions.

Source: Suwayomi/Suwayomi-Server