Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
323 stars 200 forks source link

Purple Team Vulnerability Assessment of ERTP + Zoe #4264

Closed jessysaurusrex closed 2 years ago

jessysaurusrex commented 2 years ago

As part of the process for launching mainnet 1, Agoric will be engaging in a fully remote, week-long collaborative bug hunt to assess the strengths and weaknesses of ERTP and Zoe, the digital asset standard and smart contract platform that ensure offer safety and rights conservation for users.

This exercise is open to members of the Agoric community! If you would like to participate in our code walkthroughs or bug hunting exercises, please email jessy@agoric.com. You can learn more about Purple Teaming and why Agoric favors a collaborative bug hunting approach in the first Purple Team Report on HardenedJS.

Over the next few months, there will be several more Purple Team engagements that include the RUN protocol, the kernel, governance, the wallet UI and smart contract, and a handful of other vital tools and components needed to power the economy and ecosystem.

šŸ„… Goals

šŸ—“Schedule: Jan 10-14, 2022

Monday: Opening Ceremonies + Code Walkthrough 9am PST - 12pm PST ; Breakout Sessions from 1pm - 3pm PST Tuesday: Code Walkthrough 9am PST - 12pm PST ; Breakout Sessions from 1pm - 3pm PST Wednesday: Bug Hunting 9:30am PST - 12pm PST ; Breakout Sessions from 1pm - 3pm PST, to allow for the monthly Agoric Community Call Thursday: Bug Hunting 9am PST - 12pm PST ; Breakout Sessions from 1pm - 3pm PST Friday: 9am PST - 12pm PST ; Closing Ceremonies from 1pm - 3pm PST

šŸ“ā€ā˜ ļøTeams

Deep cooperation between bug hunters and core maintainers is a key focus of Purple Teaming. By partnering and sharing intelligence with one another, the teams can more thoroughly evaluate the code than if they were competing against one another.

Red Team: @mhofman, @dckc, @gibson042, @b4d2 Blue Team: @erights, @Chris-Hibbert, @dtribble

šŸ”¬ Assessment Scope

The following repositories fall within the scope of this vulnerability assessment:

A commit hash will be available after Opening Ceremonies on 1/10/2022.

āœ… In Scope

The Zoe that is under review during this assessment will be included in mainnet 1 launch is not the same Zoe that we will be using in later phases of mainnet launch. Any code and security properties contained in the ERTP + Zoe repositories that impact Mainnet 1 goals, with a focus on understanding Zoeā€™s vulnerability to malicious messages are in-scope for this engagement.

ā›”ļø Out of Scope

šŸ› Security Promises + Invariants

The Attackerā€™s Guide to Zoe outlines security promises and identifies potential points of weakness in the code up for review, and is a key resource for participating in this exercise.

šŸ“šDocumentation + Resources

šŸŽ¬ Getting Started

āš–ļø ERTP

These resources should be helpful for navigating ERTP, Agoricā€™s token standard for digital assets that is written in JavaScript.

šŸ§® Zoe

Zoe is Agoricā€™s smart contract framework, which is built on ERTP. It can be used to run code on-chain, mint new digital assets, and credibly trade assets.

šŸ“ Technical Presentations and Papers

erights commented 2 years ago

Hi @jessysaurusrex great guide! One adjustment though:

Can an invitation be exchanged for BLD? If so, ā€œthe Fred problemā€ is in scope.

In the same sense that vulnerability to malicious contracts are in scope, even though they're not within the mainnet 1 threat model, I'd say the Fred problem is in scope regardless. Just like a vulnerability to a malicious contract is lower severity until we have malicious contracts, I'd say that a failure to solve the Fred problem is lower severity until invitations are tradable. Just like the rationale for the Zoe architecture cannot be understood without considering malicious contracts, the rationale also cannot be understood without considering the Fred problem. Further, a failure to solve the Fred problem will become high severity early in mainnet 2 at the latest, while malicious contracts won't be severe until mainnet 3.

erights commented 2 years ago

Some further detailed resources, which I expect to be both stale and incomplete. However, they are detailed enough to provoke thoughts about what invariants we rely on, and therefore what claims might be attacked:

https://github.com/Agoric/agoric-sdk/blob/master/packages/marshal/src/types.js

https://github.com/Agoric/agoric-sdk/blob/master/packages/marshal/docs/copyRecord-guarantees.md

https://github.com/Agoric/agoric-sdk/blob/master/packages/store/src/types.js

erights commented 2 years ago

Now that @jessysaurusrex created the audit-zestival label, I went and classified all the issues that looked potentially relevant:

https://github.com/Agoric/agoric-sdk/issues?q=is%3Aopen+label%3Aaudit-zestival+sort%3Aupdated-desc

jessysaurusrex commented 2 years ago

Thank you, @erights! Updated to clarify that the Fred Problem is in scope.

Is there a resource somewhere that explains the Fred Problem? I've encountered Fred in The Digital Path: Smart Contracts and the Third World in the Agoric Papers, but I didn't surface any explanations that could be pointed to in an audit report or blog post... just brief mentions across Github issues.

If something does not already exist, I can add creating a Fred Problem explainer to the list of things that should come out of our engagement this week.