Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metadata hashes used in a way that negates security benefits #233

Closed
jku opened this issue Mar 15, 2022 · 0 comments · Fixed by #325
Closed

metadata hashes used in a way that negates security benefits #233

jku opened this issue Mar 15, 2022 · 0 comments · Fixed by #325
Assignees
Labels

Comments

@jku
Copy link
Member

jku commented Mar 15, 2022

There seems to be a logic mistake in the way hash checks are done WRT parsing metadata: the point of having hashes for metadata is that parsing completely unverified data can be avoided. The go-tuf client implementation parses the metadata before checking the content hash. This makes using metadata hashes a bit pointless: Once the metadata has been parsed, we have access to signatures...

Details: downloadMetaFromTimestamp() downloads bytes, then calls GenerateTimestampFileMeta() that parses bytes to metadata. Then it calls TimestampFileMetaEqual() to verify byte hashes. I did not look at the same process for snapshot but I assume same is true there.

The logical order for these operations is:

  • download bytes
  • check hashes of the bytes
  • data is now known to be "vouched for" by delegating metadata: parse/unmarshal bytes into metadata
  • do the checks that require parsed metadata (signature, version, etc, ...)

this order is documented in the spec as well, although it does not explain the reason for this order of events and does not specify that data should not be parsed before hash checks.

see also #229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants