Skip to content

feat(core): expire extension grants at exclusive trusted time - #179

Merged
seonghobae merged 2 commits into
mainfrom
cursor/bc-94d1473e-eaaa-4288-a503-f968716ee343-8fe9
Aug 16, 2026
Merged

feat(core): expire extension grants at exclusive trusted time#179
seonghobae merged 2 commits into
mainfrom
cursor/bc-94d1473e-eaaa-4288-a503-f968716ee343-8fe9

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

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 afabb68c58b132f27f13ceb47bfbbd947f0fdedf and adds exclusive trusted-time expiry at 16a872c:

  • ExtensionAgentGrant carries expires_at_epoch_seconds;
  • ExtensionAccessRequest carries trusted now_epoch_seconds from the host, not a page, extension, or model clock;
  • now >= expires_at is DenyExpired after origin match and before capability check;
  • one second before the deadline still allows an otherwise exact grant;
  • missing grants, wrong extension/session/context/origin, and ungated capabilities still fail closed.

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::new and ExtensionAccessRequest::new did not accept expiry or trusted time, and DenyExpired did not exist. After those fields existed, the evaluator was updated to fail closed at the exclusive deadline. Local verification: originweave-core tests, 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_at rule as the existing sensitive-handle contract. Partial implementation of #27.

Open in Web View Automation 

cursoragent and others added 2 commits August 16, 2026 16:45
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]>
@cursor
cursor Bot requested a review from seonghobae August 16, 2026 16:52
@seonghobae
seonghobae marked this pull request as ready for review August 16, 2026 16:52
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown
Author

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 seonghobae left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@seonghobae
seonghobae merged commit 0841d2a into main Aug 16, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants