Skip to content

Use formal methods to prove security properties #271

Open

Description

@Eh2406

This is to start a conversation. I am hoping to nerd snipe someone who has the relevant knowledge into doing something I don't know how to do.

I think it would be very helpful to have a Formal Model of TUF. A mathematical model of the server and the client so that proofs can be generated of the security properties. I've seen a lot of questions about "if I just skip this step what security properties do I break", to which the answer is often "more than you realize" because this is a hard complicated problem, but is sometimes "just this one thing, if you don't care about it go ahead". It feels like a formal model would allow people to answer those questions on their own.

I have heard of https://p-org.github.io/P/ which allows modeling entities as state machines, which I think would map really well to the descriptions in the current specification. But I don't think it allows for proofs. I have had TLA+ recommended to me for doing proofs, but it has a far more flexible modeling language. I know that there are many other options available.

Activity

  1. Eh2406 commented on Feb 17, 2023

    @Eh2406
    Author
  2. JustinCappos commented on Feb 18, 2023

    @JustinCappos
    Member

    I also don't have expertise in this area, but would be happy to help others who have the right skill set with the process.

  3. trishankatdatadog commented on Feb 19, 2023

    @trishankatdatadog
    Contributor

    Something to note is that even if you had a provable specification of TUF, that would not necessarily translate to the correctness of any implementation 😕

  4. joshuagl commented on Apr 6, 2023

    @joshuagl
    Member

    I don't have expertise in this area but am increasingly interested in playing around with using formal methods with TUF.
    To add to the list of possible tools, I recently learned of Alloy.

  5. tarcieri commented on Apr 11, 2023

    @tarcieri

    Alloy may be relevant here:

    It's a model checking language for software systems which can be used to automatically find software vulnerabilities.

    It also has a visualizer, which could be useful for generating diagrams for the specification.

  6. znewman01 commented on May 22, 2023

    @znewman01

    I think this plays really nicely with another idea that's been floated: porting the TUF spec into a logic programming language like Datalog. Then, I think we could more easily reason about the correctness of an implementation using that language directly.

    I'm planning on playing with TUF+Datalog over the next couple months; will keep the community posted.

  7. trishankatdatadog commented on May 22, 2023

    @trishankatdatadog
    Contributor

    I'm planning on playing with TUF+Datalog over the next couple months; will keep the community posted.

    Please include me on your experiments? Would like to work on this together 🙂

  8. domodwyer commented on Apr 3, 2025

    @domodwyer

    Hi there,

    I have recently been working with a TUF-based system, and as part of that work I have produced a model using TLA+ that reflects my specific area of interest in the system.

    The model is used to describe and verify a number of security and liveness properties with respect to the communication between a TUF client, and the TUF repo in the presence of a MITM attacker.

    Specifically, even if the network connection is under attacker control, the clients:

    • Only ever install attested files, or
    • Are aware of DoS based on client-visible state.
    • Never accept any metadata manipulated by the attacker.
    • Are not vulnerable to mix-and-match attacks.
    • Reject attempts to roll-back state.
    • Support secure key rotation and revocation, even in hostile environments.
    • Eventually get updates (liveness).

    I'm happy to open a PR and share the model if it is of interest - if so, where would be best to PR to?

    Dom

  9. JustinCappos commented on Apr 3, 2025

    @JustinCappos
    Member
  10. domodwyer commented on Apr 4, 2025

    @domodwyer

    Hey @JustinCappos!

    Either works for me - I'd be happy to maintain the spec if / when the relevant portions of the spec change.

    Just to reiterate, it's not a model of the full TUF spec, but rather a "zoomed in" view of the client / server protocol (with signatures & concurrent key rotations). I am a fan of using a number of small, quick-to-run, focused models (as opposed to one giant model) so maybe having >1 spec over time (or even using other formal methods entirely) influences your decision.

    Does your verification exist in a location where we can check it out?

    Currently it lives in a private repo owned by Datadog - I can make a copy public on my personal repo shortly though if that helps.

    Dom

  11. patzielinski commented on Apr 4, 2025

    @patzielinski
    Contributor

    Hi @domodwyer! Justin pointed me to this and it would certainly be interesting to take a look at as someone who's interested in formal verification of software. The others on this thread will know how to best integrate this into the TUF spec, but having a public copy we could take a look for now at would be great! (even if it's just a small portion of the entire TUF spec).

  12. domodwyer commented on Apr 7, 2025

    @domodwyer
  13. trishankatdatadog commented on Apr 8, 2025

    @trishankatdatadog
    Contributor

    Having read this thread, I think it makes sense to place it inside the specification repo, provided that we always have someone who can correctly update the model every time we update the spec. What do y'all think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions