Skip to content

fix(iam): tag validation is absent — no 50-tag cap, no aws: prefix rejection, wrong key case rules #806

Closed

Description

@scttfrdmn

What

TagUser, UntagUser, TagRole and UntagRole (emulator/iam_plugin.go:2190-2549) enforce none
of the tag rules AWS documents, and emit none of the error codes AWS documents for them.

Absent today:

  • No 50-tag cap. AWS: Tags is "Array Members: Maximum number of 50 items" on every IAM
    tagging request, and CreateUser says "If any one of the tags is invalid or if you exceed the
    allowed maximum number of tags, then the entire request fails and the resource is not created"
    (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateUser.html).
  • No aws: prefix rejection. "You cannot create a tag key or value that begins with the text
    aws:" (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html).
  • No empty-key rejection. Same page: "You can create a tag with an empty value such as
    phoneNumber = . You cannot create an empty tag key." iamMemberTags
    (emulator/iam_query.go:328-345) silently drops a member with neither key nor value.
  • No character-set check. "Tag keys and values can include any combination of letters, numbers,
    spaces, and _ . : / = + - @ symbols."
  • Case sensitivity is backwards for users and roles. The merge in tagUser/tagRole
    (iam_plugin.go:2226-2239) compares keys case-sensitively, but the User Guide says "Tag key
    values for IAM users and roles are not case sensitive, but case is preserved. This means that you
    cannot have separate Department and department tag keys." Keys are case-sensitive for
    customer managed policies, instance profiles, OIDC providers, SAML providers, server certificates
    and virtual MFA devices — so the rule differs by entity type and cannot be applied uniformly.

Error codes: substrate answers ValidationError/400 for a missing name and NoSuchEntity/404 for an
absent entity. AWS's TagUser documents ConcurrentModification/409, InvalidInput/400,
LimitExceeded/409, NoSuchEntity/404 and ServiceFailure/500
(https://docs.aws.amazon.com/IAM/latest/APIReference/API_TagUser.html); substrate emits neither
InvalidInput nor LimitExceeded.

Why this is its own issue

Every item above turns a request substrate accepts today into one it refuses, so a consumer whose
test tags 60 keys, or uses an aws:-prefixed key, or relies on Department and department being
distinct, changes behaviour on upgrade. That earns its own release note rather than riding along
inside #796, which is about what a read reports and what can be tagged.

Deliberately split out of #796 while planning v0.112.0, with the user's confirmation.

Acceptance criteria

  • The 50-tag cap is enforced on CreateUser, CreateRole, TagUser and TagRole, with the
    error code AWS documents rather than a substituted one
  • An aws:-prefixed key or value, an empty key, and a character outside the documented set are
    each refused with a cited code
  • Tag keys are treated case-insensitively for users and roles and case-sensitively for the
    entity types AWS lists as sensitive — one rule per entity type, cited
  • Whichever of ConcurrentModification / ServiceFailure substrate cannot reach is stated as
    out of scope with the reason, rather than left unmentioned
  • docs/services.md records what is validated and what is not

Activity

  1. added
    type: bug
    area: iam
    on Sep 11, 2026
  2. added this to the v0.113.0 milestone on Sep 12, 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

    area: iamarea: taggingtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions