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
TAP 6 proposes adding the spec_version field to the signed portion of metadata forces all clients to fully parse data before doing any validation on it. Ideally, a client parses as little untrusted data as possible.
For example, a client might prefer to send a (protobuf) message like:
Where the signed field in the SignedMetadata message would itself be a serialized RootMetadata protobuf message. This would allow a client to skip parsing the signed data until after the contents have been verified.
In theory, this could be done with JSON where the object is
And the base64 string is itself an encoded root metadata object. This itself would actually be convenient as it would skip the need for using canonical JSON since only a string is being signed.
I don't actually have a solid suggestion at this time for how to handle the cases of varying specification versions. Putting the spec_version field in attacker controlled space is problematic in some ways as is forcing a client to fully parse all data.
Using base64 strings seems like a solution. Note that this wasn't always a problem because we previously used to list the hashes of all metadata in Snapshot. Clients could validates the hashes of metadata prior to parsing untrusted data.
There is another issue with not listing hashes in Snapshot, which I think was reported by David Lawrence. @trishankkarthik can say more.
We may again just list hashes in Snapshot, but I'm not entirely certain.
The problem with a b64 string is that wouldn't tell you anything about the spec_version. This issues is primarily meant to point out the non-triviality of resolving TAP 6 with the idea that parsing untrusted data is less secure than if it could be avoided.
The best solution I could think of since posting this would be to encode it in the URL. For example, there's a repo at http://example.com, then clients can access:
spec_version = 1 at http://example.com/v1/{root,snapshot,etc}.json as well as all targets
spec_version = 2 at http://example.com/v2/{root,snapshot,etc}.json as well as all targets
This moves it outside the metadata itself and has some of its own concerns, but I think it is a slight improvement.
Activity
vladimir-v-diaz commentedon Jun 1, 2017
Using base64 strings seems like a solution. Note that this wasn't always a problem because we previously used to list the hashes of all metadata in Snapshot. Clients could validates the hashes of metadata prior to parsing untrusted data.
There is another issue with not listing hashes in Snapshot, which I think was reported by David Lawrence. @trishankkarthik can say more.
We may again just list hashes in Snapshot, but I'm not entirely certain.
heartsucker commentedon Jun 1, 2017
The problem with a b64 string is that wouldn't tell you anything about the
spec_version. This issues is primarily meant to point out the non-triviality of resolving TAP 6 with the idea that parsing untrusted data is less secure than if it could be avoided.The best solution I could think of since posting this would be to encode it in the URL. For example, there's a repo at
http://example.com, then clients can access:spec_version = 1athttp://example.com/v1/{root,snapshot,etc}.jsonas well as all targetsspec_version = 2athttp://example.com/v2/{root,snapshot,etc}.jsonas well as all targetsThis moves it outside the metadata itself and has some of its own concerns, but I think it is a slight improvement.
trishankkarthik commentedon Jun 5, 2017
I think this is related to theupdateframework/tuf#362...
vladimir-v-diaz commentedon Jul 24, 2017
I'm closing this issue so that we keep all TAP 6 discussions in one place.