You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose DataProofs' context allowlisting (ProofVerificationOptions.KnownContexts) through CredentialVerificationOptions #22
DataProofs 2.0.0 added ProofVerificationOptions.KnownContexts: context URI allowlisting for Data Integrity verification. A proof over RDF binds the statements, not the JSON that compacted them, so a holder can present a verified document under a @context that reads its terms differently (the upstream example: boards read as sails), and it verifies on every conforming implementation. VC Data Integrity §4.6 / §2.4.1 therefore require applications to accept only known contexts. With KnownContexts set, every @context value in the secured document, at any depth, must be a listed IRI; an unlisted value, an inline context object or a null fails the document with a document-level PROOF_VERIFICATION_ERROR. Unset (today's behaviour), nothing is checked.
Credentials passes ExpectedProofPurpose / ExpectedChallenge / ExpectedDomain to the pipeline (src/Credentials.Core/Securing/Internal/DataIntegrityMechanism.cs) but does not expose KnownContexts, so a Credentials verifier cannot enable this protection without bypassing IVerifier.
Proposal
Add IReadOnlyCollection<string>? KnownContexts to CredentialVerificationOptions (and thread it through PresentationVerificationOptions / contained-credential options and the status-list / schema-credential recursion), mapped to ProofVerificationOptions.KnownContexts for the embedded Data Integrity form. Null keeps today's behaviour.
Decide whether the enveloping forms (JOSE / COSE / SD-JWT) should apply the same allowlist to the inner document's @context for consistency; they sign the JSON itself, so the respelling attack does not apply to them, but a uniform policy surface may still be wanted.
Document (SECURITY.md "Best practices") that an RDFC/bbs-2023 verifier acting on claim semantics should set it, with approved immutable contexts, as upstream advises: listing a context trusts what it references, and the option does not authenticate context contents.
Tests: an RDFC credential re-compacted under a foreign context is Rejected when the list is set and Accepted when unset; nested contexts and inline context objects; presentations embedding credentials with their own contexts.
This is a public API addition (additive, non-breaking; PublicAPI.Unshipped.txt + ApiCompat), so it did not belong in the dependency-update PR (#21), where it was noted as a follow-up.
Activity