forked from magnetik/node-webid
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
It seems that this implementation of the WebID TLS verifier does not handle fragment identifiers correctly.
Let us take the example snippet from the README, and modify the WebID URI (that represents a real person, not the Profile URI) so that it points to another fragment:
// ...
subjectaltname: 'URI:https://test_nicola.databox.me/profile/card#somebodyelse'
// ...If we run the script, the verification passes:
webid.verify(validCert, function(error, agentURI) {
console.log('error: %s', error);
console.log('agentURI: %s', agentURI);
});The below is printed:
error: null
agentURI: https://test_nicola.databox.me/profile/card#somebodyelse
Even though there is no fragment "somebodyelse" in the file!
This is bad - if using an aggregated RDF file with multiple fragments representing different persons (a normal use case, according to WebID spec examples), we are able to impersonate any of them, provided that our key (modulus/exponent) exists anywhere in the same file.
The query used for finding the person fragment should probably be tweaked.
melvincarvalho