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
When doing some testing I've come across a certain situation which will allow a signed document to be modified and still pass verification.
I've traced it back to this line in jsonld. So I wasn't sure if I should open a ticket there or here, please let me know if you'd like me to move this issue.
What's happening is if a "@type" entry is not mapped it is silently dropped from the expanded JSON and thus won't be a part of the digest. While unmapped properties are handled by the strict expansionMap provided in this library unmapped types are just dropped.
This means that the document can be modified after signing to add additional unmapped types and still be valid. On the other side it means that when signing you can unknowingly not sign the full document if you don't have all the "@type" values mapped properly.
I have made a reproducible test case here. To verify this issue you just need to:
npm i
npm run test
The text was updated successfully, but these errors were encountered:
This happens because @type unmapped values are interpreted as relative URLs (relative to the document's base URL ... and if there is no base URL, they are dropped entirely, they are not treated as present in the document). We need a PR over there that will behave just like the expansionMap does that handles terms that do not use the base URL when expanding.
Okay cool, I'm seeing this happen before toRDF like that issue talks about. It happens in the expand.js. I'm fine with closing this issue in favor of that one.
When doing some testing I've come across a certain situation which will allow a signed document to be modified and still pass verification.
I've traced it back to this line in jsonld. So I wasn't sure if I should open a ticket there or here, please let me know if you'd like me to move this issue.
What's happening is if a "@type" entry is not mapped it is silently dropped from the expanded JSON and thus won't be a part of the digest. While unmapped properties are handled by the strict expansionMap provided in this library unmapped types are just dropped.
This means that the document can be modified after signing to add additional unmapped types and still be valid. On the other side it means that when signing you can unknowingly not sign the full document if you don't have all the "@type" values mapped properly.
I have made a reproducible test case here. To verify this issue you just need to:
The text was updated successfully, but these errors were encountered: