OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Michael Schloh
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   06-Aug-2004 15:54:18
  Branch: OPENPKG_2_0_SOLID                Handle: 2004080614541800

  Modified files:           (Branch: OPENPKG_2_0_SOLID)
    openpkg-src/cvstrac     cvstrac.patch cvstrac.spec

  Log:
    add logic to repair remote arbitrary code execution exploit
    (SA-2004.036)

  Summary:
    Revision    Changes     Path
    1.2.2.1     +99 -0      openpkg-src/cvstrac/cvstrac.patch
    1.32.2.2    +1  -1      openpkg-src/cvstrac/cvstrac.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/cvstrac/cvstrac.patch
  ============================================================================
  $ cvs diff -u -r1.2 -r1.2.2.1 cvstrac.patch
  --- openpkg-src/cvstrac/cvstrac.patch 4 Dec 2003 15:47:21 -0000       1.2
  +++ openpkg-src/cvstrac/cvstrac.patch 6 Aug 2004 13:54:18 -0000       1.2.2.1
  @@ -169,3 +169,102 @@
      }
      zLast = db_short_query("SELECT min(-invtime) FROM wiki WHERE name='%s'",pg);
      if( zLast ){
  +Index: setup.c
  +--- setup.c.orig     2002-12-16 16:57:33 +0100
  ++++ setup.c  2004-08-06 15:06:47 +0200
  +@@ -881,10 +881,10 @@
  +   @ <tr><td bgcolor="#e0c0c0">
  +   @ <big><b>Important Security Note</b></big>
  +   @
  +-  @ <p>Be sure to enclose the filename substitutions in single-quotes.
  +-  @ (ex <tt>'%%F'</tt>)  Otherwise, a user who can check in new files
  +-  @ (with unusual names) can cause arbitrary shell
  +-  @ commands to be run on your system.</p>
  ++  @ <p>Be sure to enclose the filename and version substitutions in
  ++  @ single-quotes. (ex <tt>'%%V2'</tt> and <tt>'%%F'</tt>)  Otherwise,
  ++  @ a user who can check in new files (with unusual names) can cause
  ++  @ arbitrary shell commands to be run on your system.</p>
  +   @  
  +   @ <p>CVSTrac will not attempt to diff a file whose name contains a
  +   @ single-quote
  +@@ -911,7 +911,7 @@
  +   @ <p>If you leave the above entry blank, the following command is used:</p>
  +   @
  +   @ <blockquote><pre>
  +-  @ rcsdiff -q -r%%V1 -r%%V2 -u '%%F'
  ++  @ rcsdiff -q -r '%%V1' -r '%%V2' -u '%%F'
  +   @ </pre></blockquote>
  +   @ </form>
  +   @ </p>
  +@@ -943,7 +943,7 @@
  +   @ <p>If you leave the above entry blank, the following command is used:</p>
  +   @
  +   @ <blockquote><pre>
  +-  @ co -q -p%%V '%%F' | diff -c /dev/null -
  ++  @ co -q -p '%%V' '%%F' | diff -c /dev/null -
  +   @ </pre></blockquote>
  +   @ </form>
  +   @ </p>
  +Index: timeline.c
  +--- timeline.c.orig  2002-12-16 17:36:11 +0100
  ++++ timeline.c       2004-08-06 15:39:06 +0200
  +@@ -722,6 +722,25 @@
  + }
  + 
  + /*
  ++** Check to see that a CVS tag is good.
  ++**
  ++** A good CVS tag is either a numeric format x.y.z or must be alphanumeric,
  ++** possibly using _ and -. Technically a symbolic tag should start with
  ++** a letter but this function is intended to be simple and catch shell
  ++** characters.
  ++*/
  ++static int is_cvs_revision(const char *tag) {
  ++  int i;
  ++  if( tag == NULL ) return 1;  /* empty tag is good */
  ++  for( i = 0; tag[i]; i++ ) {
  ++    if( !isalnum(tag[i]) && tag[i] != '_' && tag[i] != '-' && tag[i] != '.' ){
  ++      return 0;
  ++    }
  ++  }
  ++  return 1;
  ++}
  ++
  ++/*
  + ** Diff two versions of a file, handling all exceptions.
  + **
  + ** If oldVersion is NULL, then this function will output the
  +@@ -763,17 +782,31 @@
  +     }
  +   }
  + 
  ++  if( !is_cvs_revision(newVersion) ){
  ++    @ <p>
  ++    @ Tag %h(newVersion) contains invalid characters.
  ++    @ </p>
  ++    return;
  ++  }
  ++
  ++  if( !is_cvs_revision(oldVersion) ){
  ++    @ <p>
  ++    @ Tag %h(oldVersion) contains invalid characters.
  ++    @ </p>
  ++    return;
  ++  }
  ++
  +   /* Find the command used to compute the file difference.
  +   */
  +   azSubst[0] = "F";
  +   azSubst[1] = file;
  +   if( oldVersion[0]==0 ){
  +-    zTemplate = db_config("filelist","co -q -p%V '%F' | diff -c /dev/null -");
  ++    zTemplate = db_config("filelist","co -q -p '%V' '%F' | diff -c /dev/null -");
  +     azSubst[2] = "V";
  +     azSubst[3] = newVersion;
  +     azSubst[4] = 0;
  +   }else{
  +-    zTemplate = db_config("filediff","rcsdiff -q -r%V1 -r%V2 -u '%F'");
  ++    zTemplate = db_config("filediff","rcsdiff -q -r '%V1' -r '%V2' -u '%F'");
  +     azSubst[2] = "V1";
  +     azSubst[3] = oldVersion;
  +     azSubst[4] = "V2";
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/cvstrac/cvstrac.spec
  ============================================================================
  $ cvs diff -u -r1.32.2.1 -r1.32.2.2 cvstrac.spec
  --- openpkg-src/cvstrac/cvstrac.spec  18 Feb 2004 14:48:43 -0000      1.32.2.1
  +++ openpkg-src/cvstrac/cvstrac.spec  6 Aug 2004 13:54:18 -0000       1.32.2.2
  @@ -34,7 +34,7 @@
   Group:        Database
   License:      GPL
   Version:      1.1.2
  -Release:      2.0.0
  +Release:      2.0.1
   
   #   list of sources
   Source0:      http://www.hwaci.com/sw/cvstrac/cvstrac-%{version}.tar.gz
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to