feat(core): expire extension grants at exclusive trusted time - #179
Conversation
Keep an extension-to-Agent grant from surviving same-session navigation or a port change. RFC 6454 treats scheme, host, and port as the origin tuple, so evaluate_extension_access now requires the request origin to match the grant. Co-authored-by: Seongho Bae <[email protected]>
Bind ExtensionAgentGrant to an exclusive expiry and require trusted evaluation time on ExtensionAccessRequest so a same-origin grant cannot be reused at or after the Agent Task deadline. Co-authored-by: Seongho Bae <[email protected]>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
seonghobae
left a comment
There was a problem hiding this comment.
Reviewed exact head 16a872cddd0e336adfe0a686a75d057c05d8c74a against protected main 0c376acf059be9ddddddfbde1d0189e4f39ef014. The change composes canonical-origin matching with host-supplied trusted time and exclusive expiry (now >= expires_at) before capability admission, preserves fail-closed mismatch ordering, and adds boundary coverage for before/at/after expiry while keeping task identity and runtime/browser integration explicitly out of scope. Exact-head CI, Manifest V3 compatibility, SAST, and Security Scan are successful; no unresolved review threads are present. I found no source-level defect in this bounded slice.
Buyer-visible gap
Partial implementation of #27. After origin-bound grants (#177), a grant that still matches extension identity, session, browsing context, and canonical origin remains usable after the Agent Task window ends. ADR 0013 requires exclusive expiry. A buyer cannot treat a same-origin grant as time-bounded without that check.
Current exact implemented boundary
This branch is stacked on #177
afabb68c58b132f27f13ceb47bfbbd947f0fdedfand adds exclusive trusted-time expiry at16a872c:ExtensionAgentGrantcarriesexpires_at_epoch_seconds;ExtensionAccessRequestcarries trustednow_epoch_secondsfrom the host, not a page, extension, or model clock;now >= expires_atisDenyExpiredafter origin match and before capability check;This PR does not bind task identity, install an extension, parse Chrome messages, or mint Agent capabilities from Manifest V3 permissions. Do not fold Chrome-permission isolation (#175), MV3 downloads (#43), or HTTP (#37) onto this head.
Prefer this head over merging #177 alone once exact-head checks succeed. #177 remains the origin-only review vehicle.
TDD
The first compile failed because
ExtensionAgentGrant::newandExtensionAccessRequest::newdid not accept expiry or trusted time, andDenyExpireddid not exist. After those fields existed, the evaluator was updated to fail closed at the exclusive deadline. Local verification:originweave-coretests, Clippy-D warnings, rustdoc-D warnings, and the extension-authority / product-documentation Python contracts passed.Standards
Lodderstedt, T., Bradley, J., Labunets, A., & Fett, D. (2025). OAuth 2.0 security best current practice (RFC 9700). Internet Engineering Task Force. https://doi.org/10.17487/RFC9700
Exclusive expiry uses the same
now >= expires_atrule as the existing sensitive-handle contract. Partial implementation of #27.