security: route external references through trust ref - #325969
security: route external references through trust ref#325969Vincent Biret (baywet) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Routes external JSON schema references through client-side trust checks by limiting the server’s default protocol handling.
Changes:
- Defaults server-side schema loading to
file:URIs. - Updates schema-loading documentation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
extensions/json-language-features/server/src/jsonServer.ts |
Delegates non-file schema requests to the client by default. |
extensions/json-language-features/server/README.md |
Documents the revised default behavior. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Can you describes more the issue it describe to fix and the steps to reproduce the issue? The fix in the PR does not impact VS Code, only on other editors that bundle the JSON language server and do not specify handledSchemaProtocols in the language server init options. |
|
Here is the reproduction (pre-patch)
This patch makes any external reference resolution go through the trust mechanism, so they are not "trusted by default". Let me know if you have any additional comments or questions. |
|
Note sure what exactly the steps 1. and 2. mean, maybe you can provide the document and how you set the schema.
Note that we trust all schemas from
What I found is that sometime the 'Location https://spec.openapis.org/overlay/1.1/schema/2026-04-01 is untrusted' message is not showing, instead 'overlay is missing' shows. Looks like a race condition. |
|
Investigated the issue why 'Location https://spec.openapis.org/overlay/1.1/schema/2026-04-01 is untrusted' message is not always showing. |
|
Vincent Biret (@baywet) If you can still provide the detailed steps for 1. and 2. that would be helpful. Input document, file name, how you configured the association. |
|
Martin Aeschlimann (@aeschli) thanks for looking into it! Yes I read the issue and pull request you created, and the behavior (from an end user perspective) is what I was experiencing. I'm ok with closing this pr once yours gets merged and revisiting of I still experience anything odd in that area. |


this pull request routes external references through trust refs when resolving schemas for json. Previously we were only requesting to trust the "root" schema, but it can ref into something external, which brings additional security concerns, e.g. https://www.schemastore.org/openapi-overlay-1.X.json which refs into https://spec.openapis.org/overlay/1.0/schema/2026-04-01