You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Metadata API: prevent Delegation role names to be one of top level metadata roles #1558
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.
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?
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
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.
Activity
joshuagl commentedon Sep 6, 2021
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?
jku commentedon Sep 6, 2021
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
jku commentedon Sep 22, 2021
the legacy client also prevents empty string as rolename -- this seems like a reasonable take for ngclient too
joshuagl commentedon Oct 27, 2021
@MVrachev is this issue covered by #1630?
MVrachev commentedon Oct 27, 2021
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
Targetsthe same way it's done in #1630.MVrachev commentedon Nov 17, 2021
When solving this issue please add tests in
test_metadata_serialization.pythe same way it's done in #1630 specifically seeincorect_roots.kairoaraujo commentedon Nov 24, 2021
I am working on this issue.