Skip to content
This repository was archived by the owner on Jul 6, 2020. It is now read-only.
This repository was archived by the owner on Jul 6, 2020. It is now read-only.

Potential confidentiality breach with DELETE queries.  #2

Open

Description

@kjetilk

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

DELETE DATA {
  <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.

Activity

  1. RubenVerborgh commented on Jan 17, 2020

    @RubenVerborgh

    Ideally, DELETE should only require acl:Write permissions.

    Interestingly, this point brings up a lot of others.

    1. 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.

    2. The scope of this issue is clearly PATCH so I have added a label for that.

    3. 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.

  2. added
    HTTP PATCH body
    on Jan 17, 2020
  3. kjetilk commented on Jan 17, 2020

    @kjetilk
    Author

    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.

  4. ericprud commented on Jan 18, 2020

    @ericprud

    For an example, imagine a malicious user "Mallory": Mallory is authorized to write, but not to read,

    This may seem contrived, but has actually been the basis for some queue systems like (iirc) VMS Mail.

  5. kjetilk commented on Mar 7, 2020

    @kjetilk
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    HTTP PATCH body

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions