Skip to content

ListStreams: the table name gate checks 3 to 255 characters while the other operations check the configured bounds #992

Open

Description

@LeeroyHannigan

The table name gate in crates/server/src/table_name_gate.rs (#830) refuses a ListStreams TableName shorter than 3 or longer than 255 characters. The answer is ValidationException "TableName must be at least 3 characters long and at most 255 characters long". The bounds are literals in the gate's ListStreams arm (line 133 at 95425f5) and in the text (line 77).

The other table operations check the length with validate_table_name in crates/core/src/validation/mod.rs. That function reads limits.min_table_name_length and limits.max_table_name_length, and a deployment can raise the maximum above 255. For those operations the gate leaves a name inside the character pattern to the engine handlers.

So on a deployment with max_table_name_length = 300, CreateTable accepts a name of 300 characters. Then ListStreams with that name answers the 3 to 255 text, and it never reaches the handler.

This comes from reading the code. It was not run on a deployment with raised limits.

Proposed fix: take the bounds of the gate's ListStreams arm, and of its text, from the deployment's limits, as validate_table_name does. With the default limits (3 and 255) the answer stays the same.

Activity

  1. LeeroyHannigan commented on Nov 25, 2026

    @LeeroyHannigan
    CollaboratorAuthor

    The same fixed bounds appear in two more places of the gate, read from the code at main 5252eda:

    • bare_name_error (crates/server/src/table_name_gate.rs, line 220) answers a name outside the character pattern in every other member that the gate checks. Its length clauses are the literals Member must have length greater than or equal to 3 and Member must have length less than or equal to 255. So on a deployment with other min_table_name_length or max_table_name_length values, such a name gets clauses that name bounds the deployment does not apply. A name inside the pattern goes to the engine, which checks the deployment's bounds.
    • Open PR fix(engine): check a restore's TargetTableName with the restore's rules #1247 checks a restore's TargetTableName in the gate with the fixed bounds (3, 255), where the engine uses the deployment's bounds.

    With the default limits, all three answers stay the same. A fix for this issue can take the bounds of all three from the deployment's limits.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions