Merge lp:~logan/ubuntu/raring/couchdb/1.2.0-5 into lp:ubuntu/raring/couchdb

Proposed by Logan Rosen
Status: Merged
Merge reported by: Jamie Strandboge
Merged at revision: not available
Proposed branch: lp:~logan/ubuntu/raring/couchdb/1.2.0-5
Merge into: lp:ubuntu/raring/couchdb
Diff against target: 219 lines (+130/-8)
9 files modified
.pc/applied-patches (+3/-0)
debian/changelog (+25/-0)
debian/patches/improve_parsing_of_mochiweb_relative_paths.patch (+40/-0)
debian/patches/improve_script_url_validation.patch (+26/-0)
debian/patches/include_a_comment_before_jsonp_output.patch (+20/-0)
debian/patches/series (+3/-0)
share/www/script/couch_test_runner.js (+3/-5)
src/couchdb/couch_httpd.erl (+1/-1)
src/mochiweb/mochiweb_util.erl (+9/-2)
To merge this branch: bzr merge lp:~logan/ubuntu/raring/couchdb/1.2.0-5
Reviewer Review Type Date Requested Status
Jamie Strandboge Approve
Ubuntu branches Pending
Review via email: mp+144195@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thanks for your merge! ACK, though in the future you might also file a security bug and subscribe ubuntu-security-sponsors so a member of the security team could review it. Thanks again.

review: Approve
Revision history for this message
Logan Rosen (logan) wrote :

Noted. Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2012-11-18 12:24:24 +0000
+++ .pc/applied-patches 2013-01-21 22:49:21 +0000
@@ -3,3 +3,6 @@
3logrotate_as_couchdb.patch3logrotate_as_couchdb.patch
4couchdb_sighup.patch4couchdb_sighup.patch
5wait_for_couchdb_stop.patch5wait_for_couchdb_stop.patch
6improve_parsing_of_mochiweb_relative_paths.patch
7improve_script_url_validation.patch
8include_a_comment_before_jsonp_output.patch
69
=== modified file 'debian/changelog'
--- debian/changelog 2012-12-25 03:35:04 +0000
+++ debian/changelog 2013-01-21 22:49:21 +0000
@@ -1,3 +1,28 @@
1couchdb (1.2.0-5ubuntu1) raring; urgency=low
2
3 * Merge from Debian unstable. Remaining changes:
4 - debian/rules, debian/control: Split couchdb and couchdb-bin.
5 - debian/postinst: Rename to couchdb-bin.postinst.
6 - debian/couchdb-bin.postrm: Don't try to delete couchdb system
7 user/group.
8
9 -- Logan Rosen <logatronico@gmail.com> Mon, 21 Jan 2013 17:26:25 -0500
10
11couchdb (1.2.0-5) unstable; urgency=high
12
13 * Fix debian/patches/series for CVE-2012-5649 and CVE-2012-5650 fixes.
14
15 -- Laszlo Boszormenyi (GCS) <gcs@debian.hu> Fri, 18 Jan 2013 22:04:32 +0100
16
17couchdb (1.2.0-4) unstable; urgency=high
18
19 * Fix CVE-2012-5649 and CVE-2012-5650 with adding upstream fixes as patches:
20 improve_parsing_of_mochiweb_relative_paths.patch ,
21 improve_script_url_validation.patch and
22 include_a_comment_before_jsonp_output.patch (closes: #698439).
23
24 -- Laszlo Boszormenyi (GCS) <gcs@debian.hu> Fri, 18 Jan 2013 20:04:01 +0100
25
1couchdb (1.2.0-3ubuntu1) raring; urgency=low26couchdb (1.2.0-3ubuntu1) raring; urgency=low
227
3 * Merge from Debian unstable. Remaining changes:28 * Merge from Debian unstable. Remaining changes:
429
=== added file 'debian/patches/improve_parsing_of_mochiweb_relative_paths.patch'
--- debian/patches/improve_parsing_of_mochiweb_relative_paths.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/improve_parsing_of_mochiweb_relative_paths.patch 2013-01-21 22:49:21 +0000
@@ -0,0 +1,40 @@
1Description: improve parsing of mochiweb relative paths
2 Patch adapted from http://www.couchbase.com/issues/browse/MB-7390
3Author: Sriram Melkote <siri@couchbase.com>
4Bug-Debian: http://bugs.debian.org/698439
5Last-Update: 2012-12-15
6
7---
8
9diff --git a/src/mochiweb/mochiweb_util.erl b/src/mochiweb/mochiweb_util.erl
10index 3b50fe7..6b88818 100644
11--- a/src/mochiweb/mochiweb_util.erl
12+++ b/src/mochiweb/mochiweb_util.erl
13@@ -68,11 +68,17 @@ partition2(_S, _Sep) ->
14 %% @spec safe_relative_path(string()) -> string() | undefined
15 %% @doc Return the reduced version of a relative path or undefined if it
16 %% is not safe. safe relative paths can be joined with an absolute path
17-%% and will result in a subdirectory of the absolute path.
18+%% and will result in a subdirectory of the absolute path. Safe paths
19+%% never contain a backslash character.
20 safe_relative_path("/" ++ _) ->
21 undefined;
22 safe_relative_path(P) ->
23- safe_relative_path(P, []).
24+ case string:chr(P, $\\) of
25+ 0 ->
26+ safe_relative_path(P, []);
27+ _ ->
28+ undefined
29+ end.
30
31 safe_relative_path("", Acc) ->
32 case Acc of
33@@ -809,6 +815,7 @@ safe_relative_path_test() ->
34 undefined = safe_relative_path("../foo"),
35 undefined = safe_relative_path("foo/../.."),
36 undefined = safe_relative_path("foo//"),
37+ undefined = safe_relative_path("foo\\bar"),
38 ok.
39
40 parse_qvalues_test() ->
041
=== added file 'debian/patches/improve_script_url_validation.patch'
--- debian/patches/improve_script_url_validation.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/improve_script_url_validation.patch 2013-01-21 22:49:21 +0000
@@ -0,0 +1,26 @@
1Description: Improve script url validation
2Author: Robert Newson <rnewson@apache.org>
3Bug-Debian: http://bugs.debian.org/698439
4Last-Update: 2012-12-18
5
6---
7
8diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js
9index c1e7a72..60ba11c 100644
10--- a/share/www/script/couch_test_runner.js
11+++ b/share/www/script/couch_test_runner.js
12@@ -15,11 +15,9 @@
13
14 function loadScript(url) {
15 // disallow loading remote URLs
16- if((url.substr(0, 7) == "http://")
17- || (url.substr(0, 2) == "//")
18- || (url.substr(0, 5) == "data:")
19- || (url.substr(0, 11) == "javascript:")) {
20- throw "Not loading remote test scripts";
21+ var re = /^[a-z0-9_]+(\/[a-z0-9_]+)*\.js#?$/;
22+ if (!re.test(url)) {
23+ throw "Not loading remote test scripts";
24 }
25 if (typeof document != "undefined") document.write('<script src="'+url+'"></script>');
26 };
027
=== added file 'debian/patches/include_a_comment_before_jsonp_output.patch'
--- debian/patches/include_a_comment_before_jsonp_output.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/include_a_comment_before_jsonp_output.patch 2013-01-21 22:49:21 +0000
@@ -0,0 +1,20 @@
1Description: Include a comment before jsonp output
2Author: Robert Newson <rnewson@apache.org>
3Bug-Debian: http://bugs.debian.org/698439
4Last-Update: 2012-12-19
5
6---
7
8diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
9index 0be7126..58f5ec6 100644
10--- a/src/couchdb/couch_httpd.erl
11+++ b/src/couchdb/couch_httpd.erl
12@@ -746,7 +746,7 @@ start_jsonp() ->
13 case get(jsonp) of
14 no_jsonp -> [];
15 [] -> [];
16- CallBack -> CallBack ++ "("
17+ CallBack -> ["/* CouchDB */", CallBack, "("]
18 end.
19
20 end_jsonp() ->
021
=== modified file 'debian/patches/series'
--- debian/patches/series 2012-11-18 12:24:24 +0000
+++ debian/patches/series 2013-01-21 22:49:21 +0000
@@ -3,3 +3,6 @@
3logrotate_as_couchdb.patch3logrotate_as_couchdb.patch
4couchdb_sighup.patch4couchdb_sighup.patch
5wait_for_couchdb_stop.patch5wait_for_couchdb_stop.patch
6improve_parsing_of_mochiweb_relative_paths.patch
7improve_script_url_validation.patch
8include_a_comment_before_jsonp_output.patch
69
=== modified file 'share/www/script/couch_test_runner.js'
--- share/www/script/couch_test_runner.js 2012-07-30 22:49:59 +0000
+++ share/www/script/couch_test_runner.js 2013-01-21 22:49:21 +0000
@@ -15,11 +15,9 @@
1515
16function loadScript(url) {16function loadScript(url) {
17 // disallow loading remote URLs17 // disallow loading remote URLs
18 if((url.substr(0, 7) == "http://")18 var re = /^[a-z0-9_]+(\/[a-z0-9_]+)*\.js#?$/;
19 || (url.substr(0, 2) == "//")19 if (!re.test(url)) {
20 || (url.substr(0, 5) == "data:")20 throw "Not loading remote test scripts";
21 || (url.substr(0, 11) == "javascript:")) {
22 throw "Not loading remote test scripts";
23 }21 }
24 if (typeof document != "undefined") document.write('<script src="'+url+'"></script>');22 if (typeof document != "undefined") document.write('<script src="'+url+'"></script>');
25};23};
2624
=== modified file 'src/couchdb/couch_httpd.erl'
--- src/couchdb/couch_httpd.erl 2012-07-30 22:49:59 +0000
+++ src/couchdb/couch_httpd.erl 2013-01-21 22:49:21 +0000
@@ -746,7 +746,7 @@
746 case get(jsonp) of746 case get(jsonp) of
747 no_jsonp -> [];747 no_jsonp -> [];
748 [] -> [];748 [] -> [];
749 CallBack -> CallBack ++ "("749 CallBack -> ["/* CouchDB */", CallBack, "("]
750 end.750 end.
751751
752end_jsonp() ->752end_jsonp() ->
753753
=== modified file 'src/mochiweb/mochiweb_util.erl'
--- src/mochiweb/mochiweb_util.erl 2012-07-30 22:49:54 +0000
+++ src/mochiweb/mochiweb_util.erl 2013-01-21 22:49:21 +0000
@@ -68,11 +68,17 @@
68%% @spec safe_relative_path(string()) -> string() | undefined68%% @spec safe_relative_path(string()) -> string() | undefined
69%% @doc Return the reduced version of a relative path or undefined if it69%% @doc Return the reduced version of a relative path or undefined if it
70%% is not safe. safe relative paths can be joined with an absolute path70%% is not safe. safe relative paths can be joined with an absolute path
71%% and will result in a subdirectory of the absolute path.71%% and will result in a subdirectory of the absolute path. Safe paths
72%% never contain a backslash character.
72safe_relative_path("/" ++ _) ->73safe_relative_path("/" ++ _) ->
73 undefined;74 undefined;
74safe_relative_path(P) ->75safe_relative_path(P) ->
75 safe_relative_path(P, []).76 case string:chr(P, $\\) of
77 0 ->
78 safe_relative_path(P, []);
79 _ ->
80 undefined
81 end.
7682
77safe_relative_path("", Acc) ->83safe_relative_path("", Acc) ->
78 case Acc of84 case Acc of
@@ -809,6 +815,7 @@
809 undefined = safe_relative_path("../foo"),815 undefined = safe_relative_path("../foo"),
810 undefined = safe_relative_path("foo/../.."),816 undefined = safe_relative_path("foo/../.."),
811 undefined = safe_relative_path("foo//"),817 undefined = safe_relative_path("foo//"),
818 undefined = safe_relative_path("foo\\bar"),
812 ok.819 ok.
813820
814parse_qvalues_test() ->821parse_qvalues_test() ->

Subscribers

People subscribed via source and target branches

to all changes: