-
Notifications
You must be signed in to change notification settings - Fork 18
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
Disambiguate between UCAN capabilities that are introduced through delegation vs. introduced "via parenthood" #21
Comments
I have trained my whole life for this moment |
By ambient authority seems clearer to me than by parenthood. It brings the focus to where the capability comes from instead of the relation in the data structure, which aligns it with delegated authority. That makes it easier for my brain to compare the two. 🚴 🤘 |
@matheus23 with |
No, I wouldn't say so. It's true that for the But the issue here is with all other capabilities: I think it would be helpful to disambiguate whether all other capabilities are meant to be introduced by parenthood or not. That said, we've made some progress on the original issue. Specifically this comment:
This situation can be avoided: "Just don't assume it". Or in other words: For all capabilities, try both checking them as introduced by parenthood as well as check for delegations. |
After many discussions, we landed on the way things were before. Capabilities are proven constructively, and that's turned out to actually be plenty convenient for implementers. |
From just looking at a single UCAN (disregarding its
prf
section), it's impossible to figure out whether a certain capability was meant to be introduced "by parenthood" ("through ambient authority") or delegated from one of its proofs.Problematic Example
Let's assume a malicious actor "Mallory" and an honest actor "Alice".
Mallory has access to their own WNFS (
mallory.fission.name/public/") by ambient authority. Alice has access to her email address (
alice@email.com`) by ambient authority.Alice requests access to "Mallory"'s public WNFS. Mallory gives her this UCAN:
Which decodes to roughly this payload:
It also includes
alice@email.com
as capability, even though Mallory doesn't actually have access to that email address.However, that shouldn't stop Alice from using this UCAN for writing to Mallory's WNFS. After all, it's possible that at some point, Mallory did have access to
alice@email.com
, but for various reasons ambient authority might have changed.Alice can actually authorize WNFS writes to Mallory's WNFS against the Fission servers just fine, because Fission will ignore the invalid ambient authority in the proof. However, when she attempts to do an atomic action involving both sending an email from her email address as well as changing Mallory's WNFS, she uses this UCAN:
Which roughly decodes to this:
However, upon validating this UCAN's capabilities, a validator will assume that the email capability was meant to be delegated from Mallory, but Mallory doesn't have access to that email address.
In short: Validation fails, even though Alice should have gained access not by delegation, but by ambient authority. It's the ambiguity that prevents her from using her capability this way.
Solution
Capabilities should be marked with whether they're introduced by parenthood ("through ambient authority") or not, in which case they're assumed to be delegated from one or more capabilities in the proofs.
There's a few options for what this could look like concretely:
prt: true
("by parenthood: true") oramb: true
("by ambient authority") to capabilitiesatt
indicates capabilities delegated from proofs. Another section is added undercap
("capabilities") oramb
("ambient authority")Bikeshedding for names is very much appreciated!
Related
This also makes it easier for UCAN libraries to tell whether a capability is actually invalid and provide an error message to developers in these cases. As long as the ambiguity exists, libraries can't error out on capabilities which weren't delegated, because they have to assume they've been introduced by parenthood instead. (I feel this point is related to @Gozala's design in ucan-wg/ts-ucan#21: We can't provide much better error messages, because the semantics allow lots of ambiguity).
The text was updated successfully, but these errors were encountered: