6dc89b
6dc89b
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2014-0032
6dc89b
6dc89b
http://svn.apache.org/viewvc?view=revision&revision=1558692
6dc89b
6dc89b
--- subversion-1.7.14/subversion/mod_dav_svn/repos.c.cve0032
6dc89b
+++ subversion-1.7.14/subversion/mod_dav_svn/repos.c
6dc89b
@@ -1959,6 +1959,25 @@ get_resource(request_rec *r,
6dc89b
      of private resource, iff the SVNListParentPath directive is 'on'. */
6dc89b
   if (dav_svn__is_parentpath_list(r))
6dc89b
     {
6dc89b
+      /* Only allow GET and HEAD on the parentpath resource
6dc89b
+       * httpd uses the same method_number for HEAD as GET */
6dc89b
+      if (r->method_number != M_GET)
6dc89b
+        {
6dc89b
+          int status;
6dc89b
+
6dc89b
+          /* Marshall the error back to the client by generating by
6dc89b
+           * way of the dav_svn__error_response_tag trick. */
6dc89b
+          err = dav_svn__new_error(r->pool, HTTP_METHOD_NOT_ALLOWED,
6dc89b
+                                   SVN_ERR_APMOD_MALFORMED_URI,
6dc89b
+                                   "The URI does not contain the name "
6dc89b
+                                   "of a repository.");
6dc89b
+          /* can't use r->allowed since the default handler isn't called */
6dc89b
+          apr_table_setn(r->headers_out, "Allow", "GET,HEAD");
6dc89b
+          status = dav_svn__error_response_tag(r, err);
6dc89b
+
6dc89b
+          return dav_push_error(r->pool, status, err->error_id, NULL, err);
6dc89b
+        }
6dc89b
+
6dc89b
       err = get_parentpath_resource(r, resource);
6dc89b
       if (err)
6dc89b
         return err;