Repository navigation
Conversation
Allow the special "*" string in exposedTo and fromOrigins while preserving explicit origin validation and existing policy checks. Update specification examples and related documentation. Co-authored-by: Copilot <[email protected]>
Restrict origin wildcards to potentially trustworthy origins and share allowlist matching across discovery and exposure checks. Clarify discovery opt-in, notification timing, and wildcard risks; align documentation and track selective pattern matching. Co-authored-by: Copilot <[email protected]>
| The [=origin wildcard=] opts into all [$is origin potentially trustworthy?|potentially trustworthy$] | ||
| origins in the document's tree, not only origins trusted by the author. Authors should prefer | ||
| explicit origin lists when possible. In particular, a consumer using the [=origin wildcard=] | ||
| accepts tools exposed to it by any eligible document in that tree, including tools with untrusted |
There was a problem hiding this comment.
*which may include
|
See this is why I would have preferred for the resolution to be "explore support". There was no consensus on this, and I would like to see concrete use cases and how we would mitigate any security risks before we can consider this. Additionally, note that exposedTo and fromOrigins have very different security considerations, so it would be unwise to bundle them into a single PR. |
|
@johannhof Just to clarify, is wildcard fromOrigins the one of lesser concern for you? For fromOrigins, is the main concern that the caller might accept tools from origins it hasn’t properly vetted? Or are there other risks you have in mind? The use case I can see more clearly is for exposedTo: an application deliberately allowing anybody embedding it to operate it without having to enumerate every possible host origin. For example, a chat app could embed a cooperating web app in an iframe and interact with its exposed tools. That seems useful for the composable web. which seems to be similar to the point brought up here: #188 (comment) I do agree there’s real risk here, since exposedTo: ["*"] would allow more than just the parent, so the scope is broader than the particular use case I mentioned above. |
Restore explicit-origin-only exposedTo, simplify wildcard matching, and align examples and security documentation with the narrower scope. Co-authored-by: Copilot <[email protected]>
Thanks for chiming in, Johann. I updated the PR to only include the wildcard for fromOrigins. |
| 1. [=list/For each=] |requestedOrigin| of |from origins|: | ||
|
|
||
| 1. If |targetOrigin| is [=same origin=] with |requestedOrigin|, then set | ||
| |toolOwnerIsRequested| to true and [=iteration/break=]. |
There was a problem hiding this comment.
Can we stick with the contains prose, as it leads to a slightly more readable step with less nesting?
| |callerOrigin|; otherwise, false. | ||
|
|
||
| 1. If |includeAllOrigins| is true and |targetOrigin| is [$is origin potentially | ||
| trustworthy?|potentially trustworthy$], then set |toolOwnerIsRequested| to true. |
There was a problem hiding this comment.
Hmm, I think this excludes opaque origin secure context documents that expose tools, right? For example, a data: URL iframe is secure context but has an opaque origin, which alone is not considered potentially trustworthy. It's a secure context however, because the HTML Standard's secure context algorithm only considers the top-level navigable's creation URL.
So as we make it possible to invoke tools in those contexts, we probably also want to let fromOrigins ['*'] target them, right?
Summary
Adds the explicit
"*"origin wildcard togetTools()'sfromOriginsoption, implementing the discovery portion of the resolution in #317.fromOrigins: ["*"]to discover tools from potentially trustworthy origins in the current document's tree.Toolinterface #348 lands, the wildcard language should be updated to match its new guidance for opaque origins."*"is present.Scope
exposedToremains an explicit-origin string list, without wildcard support. Broader provider exposure requires separate consideration of its security implications.This change does not add URLPattern or subdomain-pattern support.
Related to #317.
Tests: web-platform-tests/wpt#64960.
Preview | Diff