Skip to content

Metadata API: prevent Delegation role names to be one of top level metadata roles #1558

Closed

Description

@MVrachev

Description of issue or feature request:

Current behavior:
Delegation role names are not restricted in any way in the spec, but they are targets metadata role names.
That could lead to a problem if delegation role names are one of root, timestamp, snapshot or targets.

Expected behavior:
Make sure that delegation role names aren't one of the top-level metadata roles.

Activity

  1. added
    good first issue
    backlog
    on Sep 1, 2021
  2. joshuagl commented on Sep 6, 2021

    @joshuagl
    Member

    I wonder if this kind of logic and role name sanitisation more generally belongs in metadata API? Perhaps it should be part of the (as yet undesigned) repository interface?

  3. jku commented on Sep 6, 2021

    @jku
    Member

    same check does make sense in a client: we would not want to accidentally overwrite our local root.json because a targets decides to delegate to a "root" role version 9000.

    I don't think there are practical risks of that -- the client would have to succeed in downloading and verifying the file as a targets metadata before it would be written to local disk but this still seems like a reasonable check for a client to make

  4. jku commented on Sep 22, 2021

    @jku
    Member

    the legacy client also prevents empty string as rolename -- this seems like a reasonable take for ngclient too

  5. joshuagl commented on Oct 27, 2021

    @joshuagl
    Member

    @MVrachev is this issue covered by #1630?

  6. MVrachev commented on Oct 27, 2021

    @MVrachev
    CollaboratorAuthor

    No, as the validation itself happens in the delegator class who have the full list of roles or in the case of #1630 that's Root.
    Here the validation should happen in Targets the same way it's done in #1630.

  7. MVrachev commented on Nov 17, 2021

    @MVrachev
    CollaboratorAuthor

    When solving this issue please add tests in test_metadata_serialization.py the same way it's done in #1630 specifically see incorect_roots.

  8. added this to the Sprint 13 milestone on Nov 24, 2021
  9. kairoaraujo commented on Nov 24, 2021

    @kairoaraujo
    Contributor

    I am working on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backloggood first issue

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions