Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-2186

malformed SPARQL query can cause binary objects to 'disappear'

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Fedora 4.6.0
    • Fix Version/s: Fedora 4.7.4
    • Component/s: f4-core
    • Labels:
    • Environment:
      observed in fcrepo4-vagrant
    • Sprint:
      Sprint 2016 - 18

      Description

      It is possible to cause non-RDFsource objects to "disappear" from the repository with a malformed SPARQL query. Steps to reproduce:

        1. upload a binary object, for example to http://localhost:8080/fcrepo/rest/test
        2. PATCH the metadata on this node with the following SPARQL (note the erroneous double hash-mark character in the PCDM URI):

      {code}
      url -ufedoraAdmin:secret3 -X PATCH -H "Content-Type: application/sparql-update" --data "INSERT DATA {<> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://pcdm.org/models##file> .}" "http://localhost:8080/fcrepo/rest/test/fcr:metadata"
      {code}

        3. Fedora returns a Java stack trace on subsequent accesses to the /fcr:metadata, or 404 not found errors for the nonRDF node. The exact behavior varies from browser to browser.

      I would expect fedora to catch the SPARQL syntax error before saving the malformed triple on the node, and it does seem to do this for other similar errors, but for whatever reason this one slips through and causes the resource to become unreachable.

        Attachments

          Activity

            People

            • Assignee:
              dbernstein Danny Bernstein
              Reporter:
              westgard Joshua Westgard
              Reviewer:
              Andrew Woods
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: