JSON-LD: always apply jsonld.contexts.remoteallowlist, also when strict mode is off
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 38/100
調査の方向性
Start in jsonld/ldutils.go, where NewContextLoader skips filteredDocumentLoader when allowUnlistedExternalCalls is true, then trace the caller in jsonld/jsonld.go. The change makes the allow-list filter unconditional and drops that parameter. Update the tests in jsonld/ldutils_test.go that pass true, and the flag help in jsonld/cmd.go. Done when unlisted contexts fail with ContextURLNotAllowedErr in non-strict mode and the docs are updated. The issue also asks for a v6.x deprecation warning, which is a separate change.
索引モデルが issue の本文から書いたものです。
説明
Context
Follow-up to #4615 / #4617. That fix bounds remote JSON-LD context fetches with a timeout and a failure cache. This issue removes the reason those fetches happen in the first place: in non-strict mode, the node fetches any context URL a credential refers to.
Problem
jsonld/jsonld.go builds the loader with NewContextLoader(!serverConfig.Strictmode, ...). When strict mode is off, NewContextLoader (jsonld/ldutils.go) skips the filteredDocumentLoader, so jsonld.contexts.remoteallowlist has no effect and every unknown context is fetched from the internet while the credential is verified.
- Untrusted input drives outbound requests. Credentials from the network and presentations received over HTTP choose the URLs.
- Verification depends on third-party servers. A slow or dead server stalls processing (bounded to 5 s by #4617). A changed context silently changes how credentials expand.
- Unbounded caching. json-gold's
CachingDocumentLoaderkeeps every successfully fetched URL forever. - Little value in practice. All default contexts are embedded. In a production DAG dump, the only two contexts that need a remote fetch both fail: one returns 404, the other never answers Go clients.
| Mode | Unlisted context today | Proposed (v7) |
|---|---|---|
| strict | rejected: context not on the remoteallowlist |
unchanged |
| non-strict | fetched from the internet | rejected: context not on the remoteallowlist |
Proposal
v7: always apply the allow list
NewContextLoaderalways wraps the chain infilteredDocumentLoader. Drop theallowUnlistedExternalCallsparameter.jsonld.gono longer passes!Strictmode.- Unlisted contexts end with
jsonld.ContextURLNotAllowedErr.vcr/ambassador.gohandleErroralready treats that as "ignored, finished", so the event is not retried. - Flag help in
jsonld/cmd.gochanges from "In strict mode, fetching external JSON-LD contexts is not allowed except for context-URLs listed here." to "Fetching external JSON-LD contexts is not allowed except for context-URLs listed here." - Docs:
docs/pages/deployment/verifiable-credentials.rst(fetching section) and the strict mode list indocs/pages/deployment/configuration.rst. - Release notes: breaking change, with the migration step below.
Migration for operators that use custom contexts without listing them: add the URL to jsonld.contexts.remoteallowlist, or pin it with jsonld.contexts.localmapping. Setting either list replaces the defaults, so the default entries must be repeated (see the note in the docs).
v6.x minor: deprecation warning
Before v7, log a warning when a non-strict node fetches a context that is not on the allow list, naming the URL and stating that v7 will require it to be listed. Log once per URL, not per credential. Master only, not backported to patch releases.
Scope
jsonld/ldutils.go(NewContextLoader),jsonld/jsonld.go,jsonld/cmd.go- Tests in
jsonld/ldutils_test.gothat construct the loader withtrue - Docs, release notes, the generated options table
Considerations
- Developer experience: trying out a custom credential type now needs one config entry. The error message already names the setting.
- After this change, strict mode no longer influences JSON-LD loading. The strict mode docs should drop the JSON-LD line rather than keep a misleading one.
Backport
None, master only (v7). The deprecation warning goes into the next 6.x minor release from master.
Related
- #4615: remote context fetch without timeout
- #4617: timeout and failure cache
- 主要言語
- Go
- スター
- 29
- フォーク
- 24
- 平均マージ
- 2日 18時間
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nuts-foundation/nuts-node のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nuts-foundation/nuts-node#4450 ·
メンテナーはふだん 1 日以内に返信
-
bug discuss
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
nuts-foundation/nuts-node#4436 ·
メンテナーはふだん 1 日以内に返信
-
auth bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
nuts-foundation/nuts-node#4435 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nuts-foundation/nuts-node#4321 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
nuts-foundation/nuts-node#4230 ·
メンテナーはふだん 1 日以内に返信
nuts-foundation/nuts-node の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
blinklabs-io/dingo#5636 ·
メンテナーはふだん 1 日以内に返信
-
automated-analysis bug cookie safe-outputs tool-improvement workflow-issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
github/gh-aw#71952 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
JetBrains/youtrack-cli#130 ·
メンテナーはふだん 1 日以内に返信
-
Cloudflare Pages secret sync throws TypeError when deployment_configs[environment] is undefinedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Infisical/infisical#8892 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
windvane requests one more page than it needs対応中かも @TassioSales が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
projectdiscovery/subfinder#1979 ·
メンテナーはふだん 3 日以内に返信