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