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

Vulnerability: Monotonically increasing version numbers not checked for increasing property (from Univ. of Iowa report) #268

Open
Yasho-Bapat opened this issue Nov 5, 2024 · 5 comments

Comments

@Yasho-Bapat
Copy link

This vulnerability was highlighted in the University of Iowa report on Uptane's vulnerabilities.

Description
The idea of repositories using monotonically increasing version numbers is optional according to the Uptane Standard. However, disabling this feature will result in a degradation of the security advantages offered by Uptane. Additionally, the standard says

The payload differs depending on the role. However, the payload for all roles shares a common structure. It SHALL contain the following four attributes:

  • An indicator of the type of role (Root, Targets, Snapshot, or Timestamp)
  • An expiration date and time
  • An integer version number, which SHOULD be incremented each time the metadata file is updated
  • The role-specific metadata for the role indicated

The SHOULD recommends having an incrementing version number, but doesn't deem it necessary. As pointed out by the report, this has the potential for a specific kind of rollback attack. If a malicious actor replays an older Targets metadata file but this file doesn't have a lower version number then the version number check will pass. This is because Section 5.4.4.4 advises

Check that the version number of the previous Timestamp metadata file, if any, is less than or equal to the version number of this Timestamp metadata file.

Potential mitigations
This can potentially be fixed by tightening the requirements around the metadata version numbers:

  • An integer version number, which SHOULD SHALL be incremented each time the metadata file is updated
  • Check that the version number of the previous Timestamp metadata file, if any, is less than or equal to the version number of this Timestamp metadata file.

Please provide your thoughts on this below.

@JustinCappos
Copy link
Contributor

JustinCappos commented Nov 6, 2024 via email

@JustinCappos
Copy link
Contributor

JustinCappos commented Nov 6, 2024 via email

@iramcdonald
Copy link

iramcdonald commented Nov 6, 2024 via email

@tkfu
Copy link
Member

tkfu commented Nov 26, 2024

Right, so there is also a need in many Uptane installations to be able to do a rollback to a limited number of versions prior. There are several ways this can work. One way is for the image repository to only contain copies of metadata for the versions which should be valid in this way. As such, the proposed change here would break this workflow...

We discussed this in the Standards committee call last week, but I'm also writing it here for posterity. There's no breakage of the workflow described, as the version numbers in question here are the version numbers of the metadata files, not the version numbers of the individual targets.

Indeed, it should be emphasized that version numbers (or version strings) are not a property that individual targets necessarily have. In 5.2.3.1 Metadata about images, the only required properties for a target to have are filename, size, and hash. It's certainly quite common for a version field to be included in custom metadata, and for filenames to follow a naming scheme that includes a version string of some sort, but it is explicitly not a requirement.

@tkfu
Copy link
Member

tkfu commented Nov 26, 2024

The broader question about requiring increasing version numbers requires some additional context, I believe.

One thing that we need to take into account in Uptane is the realities of the hardware we're expecting to deal with. One of those realities is that flash memory will eventually fail after a certain number of writes, so we need to be judicious with how frequently our update procedures require any data to be written to persistent storage. See this thread from 2019 for more discussion, but the most pertinent conclusion is that writing data once per update check is always unacceptable.

That being said, I believe that the only way to fully rectify this vulnerability is to require that Targets, Snapshot, and Timestamp metadata version numbers always be incremented when the contents of any Targets metadata file changes. We could arguably loosen this requirement a little bit, and say that you don't have to increment the version number if the only change is that you've bumped the expiry date of the file.

I do think that the description of the vulnerability as only requiring an external MitM is a little shaky, though; it depends on the idea that an external MitM allows you to permanently freeze time, which I'm not entirely convinced about. I'll leave the discussion of that question to the other issue, however.

Let's discuss further next meeting.

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

No branches or pull requests

4 participants