Skip to content

TagResource does not validate tag key and value characters #444

Open

Description

@LeeroyHannigan

What ExtendDB does

handle_tag_resource in crates/engine/src/tagging.rs checks that the resource ARN is non-empty and well-formed through validate_resource_arn, then stores the tags. It applies no character or length validation to the tag keys or values.

What DynamoDB does

Measured on 2026-10-22 with TagResource on a table:

  • A key with ! or # returns ValidationException The Tag Key provided is invalid, Key: <key>. A value with ! returns The Tag Value provided is invalid, Value: <value>.
  • A key of 128 characters is accepted and one of 129 is rejected with the same key message. A value of 256 characters is accepted and one of 257 is rejected with the value message.
  • A key starting with aws: returns ValidationException Tag Key cannot be prefixed with aws:, Key: <key>.
  • A key and value using letters, digits, spaces and _ . : / = + - @ are accepted.

Effect

ExtendDB stores tag keys and values that the service rejects at write. A tag that cannot exist on the service can be created on ExtendDB, so a policy that conditions on such a tag behaves differently between the two.

Suggested fix

Validate tag keys and values in handle_tag_resource with the rules and messages above. Non-ASCII letters were not measured, so the allowed set for them still needs a measurement.

Activity

  1. LeeroyHannigan commented on Oct 26, 2026

    @LeeroyHannigan
    CollaboratorAuthor

    Two more measurements for this one (us-east-1, 2026-10-26, 3 of 3 each): TagResource with Key: "" on an ACTIVE table answers 400 ValidationException The Tag Key provided is invalid, Key: (a trailing space after the colon, then nothing), and the same request while the table is DELETING answers the same ValidationException, not the Table is being deleted refusal that a valid tag gets there (#551). So the service validates the tag before it checks the table's status; when the validation lands here it goes before the DELETING refusal that #599 adds.

  2. added this to the 1.0 milestone on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions