Skip to content

Query and Scan: a TableName outside the pattern beside Limit 0 answers the table name, where DynamoDB answers the Limit fault #905

Open

Description

@LeeroyHannigan

What ExtendDB does

The table name gate of #830 runs first in authorize_request (crates/server/src/table_name_gate.rs), before the handler checks Limit. A request with both faults gets the table name fault.

Measured on 2026-11-06 at the head of #830 (ccdae81), SQLite and PostgreSQL:

Request ExtendDB
Scan, TableName: "a b", Limit: 0 1 validation error detected: Value 'a b' at 'tableName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9_.-]+
Query, TableName: "a b", Limit: 0, a key condition the same sentence

The #830 review reports that the merge base (25ee109) answered the Scan request with ResourceNotFoundException.

What DynamoDB does

Measured in us-east-1 on 2026-11-06, with SDK parameter validation off. Both requests answer the Limit fault, the same sentence as Limit: 0 on an existing table:

1 validation error detected: Value at 'Limit' failed to satisfy constraint: Member must have value greater than or equal to 1

Suggested fix

For Query and Scan, check Limit before the table name pattern, or let the gate pass a request whose Limit is below 1 on to the handler. Which other members DynamoDB checks before the table name was not measured. #563 covers the two text forms of the Limit sentence and #778 covers Limit beside an ExpressionAttributeValues fault.

Related: #563, #778, #830.

Activity

  1. added
    bug
    on Nov 7, 2026
  2. LeeroyHannigan commented on Nov 23, 2026

    @LeeroyHannigan
    CollaboratorAuthor

    I measured the Query row again on 2026-11-23, with one more shape: a number fault beside the table name fault.

    Amazon DynamoDB, us-east-1, 2026-11-23 at 11:56 UTC, each request twice with the same answer, Query with TableName bad name! and KeyConditionExpression pk = :p. The last column is local SQLite servers built from main at 8c64333 and from #544's branch at 5cd089d, which give the same answers, twice each. "Table name text" is 1 validation error detected: Value 'bad name!' at 'tableName' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9_.-]+.

    Request DynamoDB main and #544
    Limit: 0, :p = {"S": "x"} 1 validation error detected: Value at 'Limit' failed to satisfy constraint: Member must have value greater than or equal to 1 Table name text
    :p = {"N": "bob"} Table name text Table name text

    So the service checks the table name pattern after Limit and ahead of the numbers in ExpressionAttributeValues. check_table_name_chars runs first in authorize_request (crates/server/src/request_helpers.rs). #544 runs its Query request checks later in the same function. A fix has to move the Limit check ahead of the table name gate and keep the number check after it. I did not measure the order of ReturnConsumedCapacity or Select against the table name.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions