git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #31365 from andir/fix-cvs-CVE-2017-12836

cvs: fix CVE-2017-12836

commitcbd458a1b170053103fca04ec92c4c2bf8896023 authorTim Steinbach <NeQuissimus@users.noreply.github.com> dateTue 7 Nov 2017, 17:12 (9 years ago) parent5b84cdfd0c8c66
2 files changed+30
pkgs/applications/version-management/cvs/CVE-2017-12836.patch+29 pkgs/applications/version-management/cvs/default.nix+1
pkgs/applications/version-management/cvs/CVE-2017-12836.patchnew file+29
@@ -0,0 +1,29 @@
1+--- a/src/rsh-client.c.orig 2005-10-02 17:17:21.000000000 +0200
2++++ b/src/rsh-client.c 2017-11-07 16:56:06.957370469 +0100
3+@@ -53,7 +53,7 @@
4+ char *cvs_server = (root->cvs_server != NULL
5+ ? root->cvs_server : getenv ("CVS_SERVER"));
6+ int i = 0;
7+- /* This needs to fit "rsh", "-b", "-l", "USER", "host",
8++ /* This needs to fit "rsh", "-b", "-l", "USER", "--", "host",
9+ "cmd (w/ args)", and NULL. We leave some room to grow. */
10+ char *rsh_argv[10];
11+
12+@@ -97,6 +97,9 @@
13+ rsh_argv[i++] = root->username;
14+ }
15+
16++ /* Only non-option arguments from here. (CVE-2017-12836) */
17++ rsh_argv[i++] = "--";
18++
19+ rsh_argv[i++] = root->hostname;
20+ rsh_argv[i++] = cvs_server;
21+ rsh_argv[i++] = "server";
22+@@ -171,6 +174,7 @@
23+ *p++ = root->username;
24+ }
25+
26++ *p++ = "--";
27+ *p++ = root->hostname;
28+ *p++ = command;
29+ *p++ = NULL;
pkgs/applications/version-management/cvs/default.nix+1
@@ -11,6 +11,7 @@ stdenv.mkDerivation {
1111 patches = [
1212 ./getcwd-chroot.patch
1313 ./CVE-2012-0804.patch
14+ ./CVE-2017-12836.patch
1415 ];
1516
1617 hardeningDisable = [ "fortify" "format" ];