Fix autonomous managed capabilities #733
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows
install-capability
to be called anywhere, by closing the leak exposed by unscoped signatures.install-capability
simply mimics the "specify-for-install" part of sig scopes. However, this would be a horrible leak if unscoped signatures could now be in scope for a managed capability installed thus. The fix is to make unscoped signatures unavailable to the environment if any autonomously-installed caps are present.Otherwise, signature scoping prevents install from doing any harm. Autonomous install of a user capability when the associated signature is not scoped to that capability will result in failure to acquire the capability, so this is safe. A user attempting to fool an autonomous authority with a direct call to
install-capability
will fail for the same reason such an acquire would fail normally, as the module guard would prevent it.Indeed, autonomous guards are carefully scoped already, and the whole motivation of signature scopes is that signatures were not so scoped. With this change, autonomous caps can return to their inherent security by self-installing the capability before attempting to acquire it, and any other install is harmless by construction. Meanwhile, the one hole left in signature scoping is closed whenever any autonomous install is conducted.