nuts-foundation / nuts-specification

Contains the source of the Nuts specification RFCs.
https://nuts-foundation.gitbook.io
2 stars 0 forks source link

RFC011: add cryptographic hash to JSON-LD context URL to avoid tampering #224

Open reinkrul opened 1 year ago

reinkrul commented 1 year ago

When a JSON-LD document is processed, its contexts are resolved. These contexts are URLs pointing to a location where the JSON-LD context document can be found. When the context is changed (either by an attacker or accidentally) it becomes a vulnerability: it could give credentials a different meaning and/or changing what fields are included in the signature. Possible attacks:

This could be mitigated by adding a cryptographic hash of the context document, to the JSON-LD context URL. This means that after resolving a JSON-LD context, the resolver should hash the context and compare it with the hash in the URL.

woutslakhorst commented 1 year ago

This would also require allowlisting certain domains.

Downloading new contexts should require additional security checks.

woutslakhorst commented 1 year ago

Goal is to support additional contexts outside of our control. Governing parties of those context might want to update their contexts without we having to update our software.

Specs need to be defines for:

woutslakhorst commented 1 year ago

When downloaded, context need to be stored alongside the VCs. If past contexts are taken offline, that would be a big problem.