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 }}
This repository was archived by the owner on Jul 6, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 6, 2020. It is now read-only.
Potential confidentiality breach with DELETE queries. #2
Ideally, DELETE should only require acl:Write permissions. Currently, it seems that DELETE also require acl:Read, and the reason for this is that a success or failure status is reported for DELETE queries.
For an example, imagine a malicious user "Mallory": Mallory is authorized to write, but not to read, and does not particularly care if he destroys things, he just wants to check if certain triples were there. In that case, he can send the query
DELETEDATA {
<alice/profile#me> ex:age 14 .
}
In SPARQL 1.1, Mallory cannot tell whether the triple was there since it will always succeed, so he can't tell that Alice was in fact 14 years old. So, DELETE with acl:Write is OK. Since Solid currently reports whether the DELETE succeeded or failed, acl:Read is required to execute the query to ensure that Mallory can't tell that Alice is 14.
Ideally, DELETE should only require acl:Write permissions.
Interestingly, this point brings up a lot of others.
What is the scope of this group? The name says "query", but in some ways, the fact that the PATCH method happens to use a query language (as one of the possible bodies) might or might not make it part of "querying" as such. To be refined, probably somewhere else.
The scope of this issue is clearly PATCH so I have added a label for that.
We should probably distinguish between on the one hand HTTP DELETE (for which I agree with acl:Write; however, note that at some point, this was decided to be write permissions on the container rather than the resource), and on the other hand SPARQL UPDATE DELETE when used as a body to an HTTP PATCH request, for which I am not sure I agree with the above statement. We'd carefully need to consider, in the context of HTTP PATCH, the possible outcomes in possible different scenarios.
In SPARQL 1.1, Mallory cannot tell whether the triple was there since it will always succeed,
But SPARQL 1.1 as a protocol does not apply here, only as a query language in a body. The protocol is HTTP and the verb is PATCH.
OK, thanks for tightening the scope, indeed, this is the HTTP PATCH method, so the label is appropriate.
My assumption was that it is clear that this applies to the DELETE operation of SPARQL since this is the query panel, but it doesn't hurt to make that explicit.
Just quickly revisiting (since I had little time for this last round):
First of all, this is specifically about the use of SPARQL Update as the query language for the PATCH method. Indeed, the problem would surface for any language that communicates a status back to the client about the success or failure of a certain delete operation.
Note also that it is not tied to SPARQL Protocol in any way, the SPARQL Update spec says:
Operations all result either in success or failure.
Currently, that is safe because DELETE queries always result in a success, but the point is that if this status (i.e. if failure could happen) is somehow reported back to the client in any way, through any protocol, it could result in a breach of confidentiality. HTTP could be said to make the situation worse, because HTTP always reports a status code to the client, and so, it is a natural inclination for designers that use HTTP as a protocol to report a status from a different layer using HTTP status codes. Again, let me emphasize it is not a problem with neither SPARQL Update nor SPARQL Protocol as currently specified, it is a problem because we want to use the status for a semaphore (#3).
The way that I look on this issue is through Bruce Schneier's essay The Process of Security, where I think of it as a balance between the ability for users to Limit Privilege and the implementation's ability to Embrace Simplicity.
Arguably, the simplest implementation-wise is to say that all PATCH HTTP operations that delete stuff has to happen only when the client is authorized with both read and write privileges. Doing that, however, forces the resource controller to assign more privileges to the client than the client actually needs to perform the operation in question. Thus, I think it is imperative that we explore possibilities to make sure that pure DELETEs can be performed with minimal privileges
I think it is broadly called "Principle of Least Privilege", we should embrace that in this work.
Activity
RubenVerborgh commentedon Jan 17, 2020
Interestingly, this point brings up a lot of others.
What is the scope of this group? The name says "query", but in some ways, the fact that the
PATCHmethod happens to use a query language (as one of the possible bodies) might or might not make it part of "querying" as such. To be refined, probably somewhere else.The scope of this issue is clearly
PATCHso I have added a label for that.We should probably distinguish between on the one hand HTTP
DELETE(for which I agree withacl:Write; however, note that at some point, this was decided to be write permissions on the container rather than the resource), and on the other hand SPARQL UPDATEDELETEwhen used as a body to an HTTPPATCHrequest, for which I am not sure I agree with the above statement. We'd carefully need to consider, in the context of HTTPPATCH, the possible outcomes in possible different scenarios.But SPARQL 1.1 as a protocol does not apply here, only as a query language in a body. The protocol is HTTP and the verb is
PATCH.kjetilk commentedon Jan 17, 2020
OK, thanks for tightening the scope, indeed, this is the HTTP
PATCHmethod, so the label is appropriate.My assumption was that it is clear that this applies to the
DELETEoperation of SPARQL since this is the query panel, but it doesn't hurt to make that explicit.ericprud commentedon Jan 18, 2020
This may seem contrived, but has actually been the basis for some queue systems like (iirc) VMS Mail.
kjetilk commentedon Mar 7, 2020
Just quickly revisiting (since I had little time for this last round):
First of all, this is specifically about the use of SPARQL Update as the query language for the
PATCHmethod. Indeed, the problem would surface for any language that communicates a status back to the client about the success or failure of a certain delete operation.Note also that it is not tied to SPARQL Protocol in any way, the SPARQL Update spec says:
Currently, that is safe because DELETE queries always result in a success, but the point is that if this status (i.e. if failure could happen) is somehow reported back to the client in any way, through any protocol, it could result in a breach of confidentiality. HTTP could be said to make the situation worse, because HTTP always reports a status code to the client, and so, it is a natural inclination for designers that use HTTP as a protocol to report a status from a different layer using HTTP status codes. Again, let me emphasize it is not a problem with neither SPARQL Update nor SPARQL Protocol as currently specified, it is a problem because we want to use the status for a semaphore (#3).
The way that I look on this issue is through Bruce Schneier's essay The Process of Security, where I think of it as a balance between the ability for users to Limit Privilege and the implementation's ability to Embrace Simplicity.
Arguably, the simplest implementation-wise is to say that all
PATCHHTTP operations that delete stuff has to happen only when the client is authorized with both read and write privileges. Doing that, however, forces the resource controller to assign more privileges to the client than the client actually needs to perform the operation in question. Thus, I think it is imperative that we explore possibilities to make sure that pure DELETEs can be performed with minimal privilegesI think it is broadly called "Principle of Least Privilege", we should embrace that in this work.