Package: release.debian.org Severity: normal User: [email protected] Usertags: unblock
Please unblock package subversion I prepared an upload targetting wheezy fixing #683188 and #704940. For #704940 I took the patch from the corresponding CVE entries (CVE-2013-1845, CVE-2013-1846, CVE-2013-1847, CVE-2013-1849). There is no patch for CVE-2013-1884 since it doesn't affect the version in wheezy. Concerning #683188, I just refreshed the patch used in unstable for it to apply on wheezy's version. unblock subversion/1.6.17dfsg-4+deb7u2 -- System Information: Debian Release: 7.0 APT prefers unstable APT policy: (990, 'unstable'), (500, 'stable-updates'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
diff -u subversion-1.6.17dfsg/debian/changelog subversion-1.6.17dfsg/debian/changelog --- subversion-1.6.17dfsg/debian/changelog +++ subversion-1.6.17dfsg/debian/changelog @@ -1,3 +1,16 @@ +subversion (1.6.17dfsg-4+deb7u2) wheezy; urgency=low + + * Non-maintainer upload. + * Include following security fixes (Closes: #704940): + - CVE-2013-1845: Remotely triggered memory exhaustion in mod_dav_svn + - CVE-2013-1846: Remotely triggered crash in mod_dav_svn + - CVE-2013-1847: Remotely triggered crash in mod_dav_svn + - CVE-2013-1849: Remotely triggered crash in mod_dav_svn + * Convert SVN_STREAM_CHUNK_SIZE to an integer in svn/core.py + (Closes: #683188). + + -- Thomas Preud'homme <[email protected]> Tue, 16 Apr 2013 14:36:14 +0200 + subversion (1.6.17dfsg-4+deb7u1) wheezy; urgency=low * Non-maintainer upload. diff -u subversion-1.6.17dfsg/debian/patches/series subversion-1.6.17dfsg/debian/patches/series --- subversion-1.6.17dfsg/debian/patches/series +++ subversion-1.6.17dfsg/debian/patches/series @@ -36,0 +37,4 @@ +chunksize-integer.patch +cve-2013-1845 +cve-2013-1846 +cve-2013-1849 only in patch2: unchanged: --- subversion-1.6.17dfsg.orig/debian/patches/cve-2013-1849 +++ subversion-1.6.17dfsg/debian/patches/cve-2013-1849 @@ -0,0 +1,39 @@ +Author: Philip Martin <[email protected]> +Subject: Reject operations on prop if the resource is an activity + +Subversion's mod_dav_svn Apache HTTPD server module will crash when +a PROPFIND request is made against activity URLs. The patch consists +in rejecting operations on getcontentlength and getcontenttype +properties if the resource is an activity. + +Origin: upstream, commit:r1453780 +Bug-CVE: http://subversion.apache.org/security/CVE-2013-1849-advisory.txt +Bug-Debian: http://bugs.debian.org/704940 +Last-Update: 2013-04-16 +Applied-Upstream: commit:r1453780 + +Index: subversion/mod_dav_svn/liveprops.c +=================================================================== +--- a/subversion/mod_dav_svn/liveprops.c (revision 1458455) ++++ b/subversion/mod_dav_svn/liveprops.c (working copy) +@@ -410,7 +410,8 @@ insert_prop_internal(const dav_resource *resource, + svn_filesize_t len = 0; + + /* our property, but not defined on collection resources */ +- if (resource->collection || resource->baselined) ++ if (resource->type == DAV_RESOURCE_TYPE_ACTIVITY ++ || resource->collection || resource->baselined) + return DAV_PROP_INSERT_NOTSUPP; + + serr = svn_fs_file_length(&len, resource->info->root.root, +@@ -434,7 +435,9 @@ insert_prop_internal(const dav_resource *resource, + svn_string_t *pval; + const char *mime_type = NULL; + +- if (resource->baselined && resource->type == DAV_RESOURCE_TYPE_VERSION) ++ if (resource->type == DAV_RESOURCE_TYPE_ACTIVITY ++ || (resource->baselined ++ && resource->type == DAV_RESOURCE_TYPE_VERSION)) + return DAV_PROP_INSERT_NOTSUPP; + + if (resource->type == DAV_RESOURCE_TYPE_PRIVATE only in patch2: unchanged: --- subversion-1.6.17dfsg.orig/debian/patches/cve-2013-1845 +++ subversion-1.6.17dfsg/debian/patches/cve-2013-1845 @@ -0,0 +1,189 @@ +Author: Philip Martin <[email protected]> +Subject: Introduce a subpool to control memory use + +Setting or deleting a large number of properties on a node (file or +directory) will result in a large amount of memory use. Due to the +memory pooling behavior of Apache httpd and Subversion the completion of +the request will not result in the immediate release of memory used. +Repeated commits with the same properties will result in each httpd process +plateauing out at some amount of memory. This could result in a Denial of +Service if the system is exhausted of all available memory. + +Origin: upstream, commit:r1443929 +Bug-CVE: http://subversion.apache.org/security/CVE-2013-1845-advisory.txt +Bug-Debian: http://bugs.debian.org/704940 +Last-Update: 2013-04-16 +Applied-Upstream: commit:r1443929 + + +Index: subversion/mod_dav_svn/dav_svn.h +=================================================================== +--- a/subversion/mod_dav_svn/dav_svn.h (revision 1461956) ++++ b/subversion/mod_dav_svn/dav_svn.h (working copy) +@@ -254,6 +254,9 @@ struct dav_resource_private { + interface (ie: /path/to/item?p=PEGREV]? */ + svn_boolean_t pegged; + ++ /* Cache any revprop change error */ ++ svn_error_t *revprop_error; ++ + /* Pool to allocate temporary data from */ + apr_pool_t *pool; + }; +Index: subversion/mod_dav_svn/deadprops.c +=================================================================== +--- a/subversion/mod_dav_svn/deadprops.c (revision 1461956) ++++ b/subversion/mod_dav_svn/deadprops.c (working copy) +@@ -49,8 +49,7 @@ struct dav_db { + + + struct dav_deadprop_rollback { +- dav_prop_name name; +- svn_string_t value; ++ int dummy; + }; + + +@@ -134,6 +133,7 @@ save_value(dav_db *db, const dav_prop_name *name, + { + const char *propname; + svn_error_t *serr; ++ apr_pool_t *subpool; + + /* get the repos-local name */ + get_repos_propname(db, name, &propname); +@@ -151,10 +151,14 @@ save_value(dav_db *db, const dav_prop_name *name, + } + + /* Working Baseline or Working (Version) Resource */ ++ ++ /* A subpool to cope with mod_dav making multiple calls, e.g. during ++ PROPPATCH with multiple values. */ ++ subpool = svn_pool_create(db->resource->pool); + if (db->resource->baselined) + if (db->resource->working) + serr = svn_repos_fs_change_txn_prop(db->resource->info->root.txn, +- propname, value, db->resource->pool); ++ propname, value, subpool); + else + { + /* ### VIOLATING deltaV: you can't proppatch a baseline, it's +@@ -168,19 +172,29 @@ save_value(dav_db *db, const dav_prop_name *name, + propname, value, TRUE, TRUE, + db->authz_read_func, + db->authz_read_baton, +- db->resource->pool); ++ subpool); + ++ /* mod_dav doesn't handle the returned error very well, it ++ generates its own generic error that will be returned to ++ the client. Cache the detailed error here so that it can ++ be returned a second time when the rollback mechanism ++ triggers. */ ++ if (serr) ++ db->resource->info->revprop_error = svn_error_dup(serr); ++ + /* Tell the logging subsystem about the revprop change. */ + dav_svn__operational_log(db->resource->info, + svn_log__change_rev_prop( + db->resource->info->root.rev, + propname, +- db->resource->pool)); ++ subpool)); + } + else + serr = svn_repos_fs_change_node_prop(db->resource->info->root.root, + get_repos_path(db->resource->info), +- propname, value, db->resource->pool); ++ propname, value, subpool); ++ svn_pool_destroy(subpool); ++ + if (serr != NULL) + return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, + NULL, +@@ -395,6 +409,7 @@ db_remove(dav_db *db, const dav_prop_name *name) + { + svn_error_t *serr; + const char *propname; ++ apr_pool_t *subpool; + + /* get the repos-local name */ + get_repos_propname(db, name, &propname); +@@ -403,6 +418,10 @@ db_remove(dav_db *db, const dav_prop_name *name) + if (propname == NULL) + return NULL; + ++ /* A subpool to cope with mod_dav making multiple calls, e.g. during ++ PROPPATCH with multiple values. */ ++ subpool = svn_pool_create(db->resource->pool); ++ + /* Working Baseline or Working (Version) Resource */ + if (db->resource->baselined) + if (db->resource->working) +@@ -419,11 +438,12 @@ db_remove(dav_db *db, const dav_prop_name *name) + propname, NULL, TRUE, TRUE, + db->authz_read_func, + db->authz_read_baton, +- db->resource->pool); ++ subpool); + else + serr = svn_repos_fs_change_node_prop(db->resource->info->root.root, + get_repos_path(db->resource->info), +- propname, NULL, db->resource->pool); ++ propname, NULL, subpool); ++ svn_pool_destroy(subpool); + if (serr != NULL) + return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR, + "could not remove a property", +@@ -598,19 +618,14 @@ db_get_rollback(dav_db *db, + const dav_prop_name *name, + dav_deadprop_rollback **prollback) + { +- dav_error *err; +- dav_deadprop_rollback *ddp; +- svn_string_t *propval; ++ /* This gets called by mod_dav in preparation for a revprop change. ++ mod_dav_svn doesn't need to make any changes during rollback, but ++ we want the rollback mechanism to trigger. Making changes in ++ response to post-revprop-change hook errors would be positively ++ wrong. */ + +- if ((err = get_value(db, name, &propval)) != NULL) +- return err; ++ *prollback = apr_palloc(db->p, sizeof(dav_deadprop_rollback)); + +- ddp = apr_palloc(db->p, sizeof(*ddp)); +- ddp->name = *name; +- ddp->value.data = propval ? propval->data : NULL; +- ddp->value.len = propval ? propval->len : 0; +- +- *prollback = ddp; + return NULL; + } + +@@ -618,12 +633,20 @@ db_get_rollback(dav_db *db, + static dav_error * + db_apply_rollback(dav_db *db, dav_deadprop_rollback *rollback) + { +- if (rollback->value.data == NULL) +- { +- return db_remove(db, &rollback->name); +- } ++ dav_error *derr; + +- return save_value(db, &rollback->name, &rollback->value); ++ if (! db->resource->info->revprop_error) ++ return NULL; ++ ++ /* Returning the original revprop change error here will cause this ++ detailed error to get returned to the client in preference to the ++ more generic error created by mod_dav. */ ++ derr = dav_svn__convert_err(db->resource->info->revprop_error, ++ HTTP_INTERNAL_SERVER_ERROR, NULL, ++ db->resource->pool); ++ db->resource->info->revprop_error = NULL; ++ ++ return derr; + } + + only in patch2: unchanged: --- subversion-1.6.17dfsg.orig/debian/patches/cve-2013-1846 +++ subversion-1.6.17dfsg/debian/patches/cve-2013-1846 @@ -0,0 +1,70 @@ +Author: Ben Reser <[email protected]> +Subject: Improve the logic in mod_dav_svn's implementation of LOCK + +Subversion's mod_dav_svn Apache HTTPD server module will crash in some +circumstances when a LOCK request is made against activity URL or +non-existent URL. The vulnerability can be triggered by doing a LOCK +request against an activity URL. +The vulnerability can also be triggered by doing a LOCK request against +a URL for a path that does not exist in the repository or an invalid +activity URL where authentication is not required for the LOCK +method. + +Origin: upstream, commit:r1455352 +Bug-CVE: http://subversion.apache.org/security/CVE-2013-1846-advisory.txt +Bug-CVE: http://subversion.apache.org/security/CVE-2013-1847-advisory.txt +Bug-Debian: http://bugs.debian.org/704940 +Last-Update: 2013-04-16 +Applied-Upstream: commit:r1455352 + +Index: subversion/mod_dav_svn/lock.c +=================================================================== +--- a/subversion/mod_dav_svn/lock.c (revision 1459696) ++++ b/subversion/mod_dav_svn/lock.c (working copy) +@@ -634,7 +634,20 @@ append_locks(dav_lockdb *lockdb, + svn_lock_t *slock; + svn_error_t *serr; + dav_error *derr; ++ dav_svn_repos *repos = resource->info->repos; ++ ++ /* We don't allow anonymous locks */ ++ if (! repos->username) ++ return dav_new_error(resource->pool, HTTP_UNAUTHORIZED, ++ DAV_ERR_LOCK_SAVE_LOCK, ++ "Anonymous lock creation is not allowed."); + ++ /* Not a path in the repository so can't lock it. */ ++ if (! resource->info->repos_path) ++ return dav_new_error(resource->pool, HTTP_BAD_REQUEST, ++ DAV_ERR_LOCK_SAVE_LOCK, ++ "Attempted to lock path not in repository."); ++ + /* If the resource's fs path is unreadable, we don't allow a lock to + be created on it. */ + if (! dav_svn__allow_read_resource(resource, SVN_INVALID_REVNUM, +@@ -657,7 +670,6 @@ append_locks(dav_lockdb *lockdb, + svn_fs_txn_t *txn; + svn_fs_root_t *txn_root; + const char *conflict_msg; +- dav_svn_repos *repos = resource->info->repos; + apr_hash_t *revprop_table = apr_hash_make(resource->pool); + apr_hash_set(revprop_table, SVN_PROP_REVISION_AUTHOR, + APR_HASH_KEY_STRING, svn_string_create(repos->username, +@@ -734,7 +746,7 @@ append_locks(dav_lockdb *lockdb, + + /* Convert the dav_lock into an svn_lock_t. */ + derr = dav_lock_to_svn_lock(&slock, lock, resource->info->repos_path, +- info, resource->info->repos->is_svn_client, ++ info, repos->is_svn_client, + resource->pool); + if (derr) + return derr; +@@ -741,7 +753,7 @@ append_locks(dav_lockdb *lockdb, + + /* Now use the svn_lock_t to actually perform the lock. */ + serr = svn_repos_fs_lock(&slock, +- resource->info->repos->repos, ++ repos->repos, + slock->path, + slock->token, + slock->comment, only in patch2: unchanged: --- subversion-1.6.17dfsg.orig/debian/patches/chunksize-integer.patch +++ subversion-1.6.17dfsg/debian/patches/chunksize-integer.patch @@ -0,0 +1,17 @@ +Author: W. Martin Borgert <[email protected]> + +Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683188#78 +Bug-Debian: http://bugs.debian.org/683188 +Forwarded: not-needed +Last-Update: 2016-04-16 +--- subversion-1.7.9.orig/subversion/bindings/swig/python/svn/core.py ++++ subversion-1.7.9/subversion/bindings/swig/python/svn/core.py +@@ -145,7 +145,7 @@ + # read the rest of the stream + chunks = [ ] + while 1: +- data = svn_stream_read(self._stream, SVN_STREAM_CHUNK_SIZE) ++ data = svn_stream_read(self._stream, int(SVN_STREAM_CHUNK_SIZE)) + if not data: + break + chunks.append(data)

