Apply by doing:
cd /usr/src
patch -p0 < 002_cvs.patch
And then rebuild and install cvs:
cd gnu/usr.bin/cvs
make -f Makefile.bsd-wrapper obj
make -f Makefile.bsd-wrapper
make -f Makefile.bsd-wrapper install
+ /*
+ * For security reasons, if PATHNAME is absolute or attempts to
+ * ascend outside of the current sandbox, we abort. The server should not
+ * send us anything but relative paths which remain inside the sandbox
+ * here. Anything less means a trojan CVS server could create and edit
+ * arbitrary files on the client.
+ */
+ if (isabsolute (pathname) || pathname_levels (pathname) > 0)
+ {
+ error (0, 0,
+ "Server attempted to update a file via an invalid pathname:");
+ error (1, 0, "`%s'.", pathname);
+ }
+
reposname = NULL;
read_line (&reposname);
assert (reposname != NULL);
Index: gnu/usr.bin/cvs/src/modules.c
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cvs/src/modules.c,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -p -r1.2 -r1.2.2.1
--- gnu/usr.bin/cvs/src/modules.c 12 Dec 2003 14:43:56 -0000 1.2
+++ gnu/usr.bin/cvs/src/modules.c 1 May 2004 00:19:41 -0000 1.2.2.1
@@ -170,6 +170,13 @@ do_module (db, mname, m_type, msg, callb
if (isabsolute (mname))
error (1, 0, "Absolute module reference invalid: `%s'", mname);
+ /* Similarly for directories that attempt to step above the root of the
+ * repository.
+ */
+ if (pathname_levels (mname) > 0)
+ error (1, 0, "up-level in module reference (`..') invalid: `%s'.",
+ mname);
+
/* if this is a directory to ignore, add it to that list */
if (mname[0] == '!' && mname[1] != '\0')
{