Skip to content

ngclient: recent rollback checks are buggy #1563

Closed

Description

@jku

I recently added the rollback protection checks in ngclient and am now improving ngclient testing situation. With hindsight the order is wrong: I've found an issue with the rollback checks

  • TrustedMetadataSet now considers intermediate timestamp and snapshot valid even if it is expired or version does not match meta version: it only checks final validity when the next metadata type is loaded
  • Updater currently decides if it needs to download a new metadata version based whether the local metadata was loaded correctly by TrustedMetadataSet

as a result updater thinks it does not need to download a new version of e.g. snapshot but then targets update fails because the final snapshot is not the correct version...

This should not be too hard to fix, but I'm trying to think if we can somehow combine this with #1523: it feels like a similar issue

Activity

  1. jku commented on Sep 2, 2021

    @jku
    MemberAuthor

    Some findings:

    • the decision to check meta version and expiry at "next" metadata update is correct: otherwise Updater could forget to do it
    • but updater does need a way to know if the just loaded metadata is a valid final metadata or just valid intermediate metadata: this applies to both snapshot and timestamp
    • from ngclient: review snapshot hashes/length check #1523 Updater needs to tell TrustedMetadataSet if the snapshot is local one or not (IOW has it been verified at some point or not)

    so I guess this issue and #1523 are not related...

  2. self-assigned this
    on Sep 2, 2021
  3. added a commit that references this issue on Sep 2, 2021
    c1be3eb
  4. added 3 commits that reference this issue on Sep 6, 2021
    3b0729e
    181acb0
    b2ecee0
  5. added a commit that references this issue on Sep 10, 2021
    d018279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions