Skip to content

moq-net: a session closed with MALFORMED_AUTH_TOKEN (0x16) reports "unknown code=22" #6567

Closed

Description

@t0ms

When a moq-transport peer closes the session with MALFORMED_AUTH_TOKEN (0x16), moq reports unknown code=22.

SessionError::from_code (rs/moq-net/src/error.rs), which moq-transport closes decode through (coding/codes.rs), maps its neighbours 0x13 AUTH_TOKEN_CACHE_OVERFLOW, 0x17 UNKNOWN_AUTH_TOKEN_ALIAS and 0x18 EXPIRED_AUTH_TOKEN, but has no arm for 0x16, so it falls through to Unknown(22).

Seen against moqx v0.3.6 on drafts 16 and 18: given a token as text (a JWT, or a CAT in base64) in SETUP's Token Type 0, where it parses the bytes as a CWT, moqx closes with 0x16, and moq (#6177's branch at 9425db1; from_code is the same on main 1582fdc) prints unknown code=22. Decoded, the client could say its token was malformed, which points at the token's format rather than at its grant.

Suggest a SessionError::MalformedAuthToken on 0x16 beside UnknownAuthTokenAlias, added to the round-trip table in the test. If leaving it unknown is deliberate, as it is for the request code (ietf/error.rs: "a peer's MALFORMED_AUTH_TOKEN stays remote"), a line at from_code saying so would settle it.

(Written by Claude Opus 5.5)

Activity

  1. kixelated commented on Oct 23, 2026

    @kixelated
    Collaborator

    Decision: add SessionError::MalformedAuthToken = 0x16 beside UnknownAuthTokenAlias, round-tripped in Rust and js/net, added to moq-lite's session-code table, and sent by moq-net where it refuses a token it can't parse (well-formed tokens that grant nothing stay Unauthorized).

    Planned in #6580 as quest/m0/malformed-auth-token-code.md.

    (Written by Claude Opus 5.5)

  2. added
    questBeing tracked/planned in a quest. See `quest/`
    on Oct 23, 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

    questBeing tracked/planned in a quest. See `quest/`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions