<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>93054</bug_id>
          
          <creation_ts>2005-05-18 04:51 0000</creation_ts>
          <short_desc>app-cdr/[xbiso|extract-xiso|xdvdfs-tools]: directory traversal when extracting xbox-images</short_desc>
          <delta_ts>2005-05-27 13:38:16 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <status_whiteboard>B3 [noglsa] koon</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>dercorny@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>chrb@gentoo.org</cc>
    
    <cc>hostmaster@ed-soft.at</cc>

      

      
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2005-05-18 04:51:05 0000</bug_when>
            <thetext>When extracting a specially crafted xbox-iso image, it is possible to traverse
directories. Maybe it&apos;s possible to overwrite the .bashrc with arbitrary code.

Reproducible: Always
Steps to Reproduce:
1. Get a specially crafted ISO-File
2. Extract
3. Check results

Actual Results:  
bash-2.05b$ extract-xiso test.iso
extract-xiso v2.4b2 for linux - written by in &lt;in@fishtank.com&gt;

extracting test.iso:

extracting test/.%2f..%2f..%2f..%2fTESTFILE (0 bytes) [OK]
extracting test/./../../xploit (0 bytes) [OK]
extracting
test/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA~
(0 bytes) [OK]
extracting test/OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO (0 bytes) [OK]

4 files in test.iso total 0 bytes
bash-2.05b$ xdvdfs_extract test.iso
Opening input file / device...
Mounting filesystem...
Extracting files...
/./../../xploit
/.%2f..%2f..%2f..%2fTESTFILE
/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA~
/OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
Done.
bash-2.05b$ xbiso test.iso
bash: xbiso: command not found
bash-2.05b$ ./xbiso test.iso
Failed to create root directory: File exists
Extracting file ./../../xploit
Extracting file
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA~
Extracting file OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
Extracting file .%2f..%2f..%2f..%2fTESTFILE
End of archive


Expected Results:  
Do whatever is necessary to prohibit directory traversals</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-05-18 07:48:19 0000</bug_when>
            <thetext>Upstream looks dead on xbiso and extract-xiso...
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2005-05-18 10:29:05 0000</bug_when>
            <thetext>xiso bugzilla has a bug open for &quot;Segmentation Fault (due to &apos;long filenames&apos;?)&quot;
for a while. It&apos;s probably exploitable as well. I guess when these apps were
written nobody thought about malicious ISO images.

There&apos;s a perl port of xbiso at http://www.bogus.net/~codex/files/xbiso.tar.gz.
Maybe it could be a suitable replacement (assuming it does better path checking,
it does at least force a -d option) if no fix is forthcoming. 

xdvdfs-tools seems to have an official page now
http://www.layouts.xbox-scene.com/ and a newer 2.1 release. Stefan, do you have
any idea whether it&apos;s also vulnerable?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2005-05-18 10:43:23 0000</bug_when>
            <thetext>xdvds_extract 2.1 has the same problem.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2005-05-19 03:23:52 0000</bug_when>
            <thetext>Maybe you could report it upstream? I had a quick look at the new xdvdfs tools
site but couldn&apos;t find an email address anywhere.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2005-05-19 05:55:56 0000</bug_when>
            <thetext>Ok, I tried to contact a guy called VooD via an email-address i found in his
forum-profile. Let&apos;s hope it works...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2005-05-19 13:56:43 0000</bug_when>
            <thetext>Got a response from Vood. Upstream (Somebody called CloneXB) is now aware of
this, but it&apos;ll probably take some time till he updates, since he is very busy.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vood_atari@hotmail.com</who>
            <bug_when>2005-05-20 15:22:11 0000</bug_when>
            <thetext>Hi, I checked the extractor code, and I think CloneXB didn</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vood_atari@hotmail.com</who>
            <bug_when>2005-05-20 15:22:11 0000</bug_when>
            <thetext>Hi, I checked the extractor code, and I think CloneXB didn´t make any change 
from the original by [SNK]/Supremacy. The extractor fitted our needs so we 
didn´t need to change anything and we focused on the xbox layout dumper and new 
options/fixes for the creator.

Anyway is in pure C, and is very simple,so I think It won´t be hard for a 
medium linux user to fix that. Also, I think CloneXB has not coding experiences 
with linux so...maybe you´ll get a faster solution by just asking some good 
linux coder to fix the problem. 

Btw, sorry for not including any email adress on the web, but I use to visit 
the web´s forums everyday, and either CloneXB, Moobar, and me are easily 
accesible from Xbox-Scene forums. (I had VERY bad experiences with spam, and 
users in a previous project)

If some of you finally manages to fix that security issue let me know, so I 
could send the fixes to CloneXB and include them in the next &quot;official&quot; 
release...maybe we should open a sf.net account but XBDVDFS_tools original 
coder is hard to contact (VERY...in fact all the feedback we got from him in 6 
months of work was a post in xbox-scene) and I think we should first ask him 
for his permission.

Regards</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2005-05-21 04:26:58 0000</bug_when>
            <thetext>I&apos;ve commited fixes for them all. xdvdfs-tools is version bumped and only the
latest one has the fix (I&apos;ll remove the older one if it works ;-)). Stefan can
you please test whether the fixes work with your modified ISOs and report back.

As regards sourceforge, I&apos;d say go for it, since it&apos;s GPL license and the
original author appears to have abandoned it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2005-05-21 07:44:28 0000</bug_when>
            <thetext>None of my modified images works with the patched version of xdvdfs-tools. Good
work. VooD, an sf-project would be great. xdvdfs-tools is, imho, the best tool
of the 3 mentioned in this bug, give it a try! </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2005-05-22 09:22:36 0000</bug_when>
            <thetext>Created an attachment (id=59552)
xdvdfs-tools-2.1-fnamefix.patch
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2005-05-22 09:23:23 0000</bug_when>
            <thetext>xbiso and extract-xiso patches submitted upstream, maybe someone will take care
of them. Attaching xdvdfs-tools patch here, since it has no upstream. Closing.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-05-22 12:58:46 0000</bug_when>
            <thetext>Chris: security will close it when the vulnerability will be fixed...

Please bump xdvdfs-tools with the patch, and we&apos;ll wait for upstream on the
other two.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2005-05-22 15:41:38 0000</bug_when>
            <thetext>I&apos;ve already commited patches for them all. I have a feeling upstream may be
unresponsive..</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-05-23 02:32:43 0000</bug_when>
            <thetext>Great :)

Could you revbump them so that people pick the fix up by upgrading ? This is
also needed for GLSA, should we include one.

Thx in advance</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2005-05-25 16:17:12 0000</bug_when>
            <thetext>Done. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-05-26 03:03:38 0000</bug_when>
            <thetext>Thx Chris !
Ready for GLSA vote</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vorlon@gentoo.org</who>
            <bug_when>2005-05-27 09:01:34 0000</bug_when>
            <thetext>I vote for a GLSA on this one.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2005-05-27 09:23:34 0000</bug_when>
            <thetext>i&apos;m no real dev, but i vote for no GLSA. exploitation is hard (i&apos;m not really
sure if its possible to extract actual content to files, i only managed to
overwrite with 0byte files, you&apos;ve got to know the name of the file to overwrite
etc) it&apos;s a poor directory traversal and the affected tools aren&apos;t widely spread.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-27 10:28:32 0000</bug_when>
            <thetext>I tend to vote NO on this one too. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-05-27 13:38:16 0000</bug_when>
            <thetext>Agreed it&apos;s a little unlikely, voting NO and closing.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>59552</attachid>
            <date>2005-05-22 09:22 0000</date>
            <desc>xdvdfs-tools-2.1-fnamefix.patch</desc>
            <filename>xdvdfs-tools-2.1-fnamefix.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIFhEVkRGU19Ub29scy5vcmlnL3NyYy94ZHZkZnMveGR2ZGZzLmMJMjAwMy0wOC0xNSAyMzoy
Njo1OC4wMDAwMDAwMDAgKzAwMDAKKysrIFhEVkRGU19Ub29scy9zcmMveGR2ZGZzL3hkdmRmcy5j
CTIwMDUtMDUtMjEgMTI6MTM6NTUuNjU1ODM5MjE2ICswMDAwCkBAIC0xNTcsNiArMTU3LDE0IEBA
CiAJbWVtY3B5KFNlYXJjaFJlY29yZC0+RmlsZW5hbWUsIEVudHJ5LT5GaWxlbmFtZSwgRW50cnkt
PkZpbGVuYW1lTGVuZ3RoKTsKIAlTZWFyY2hSZWNvcmQtPkZpbGVuYW1lW0VudHJ5LT5GaWxlbmFt
ZUxlbmd0aF0gPSAwOwogCisJaWYgKHN0cnN0cihTZWFyY2hSZWNvcmQtPkZpbGVuYW1lLCIuLiIp
IHx8IAorCSAgICBzdHJjaHIoU2VhcmNoUmVjb3JkLT5GaWxlbmFtZSwgJy8nKSB8fCAKKwkgICAg
c3RyY2hyKFNlYXJjaFJlY29yZC0+RmlsZW5hbWUsICdcXCcpKQorCSAgeworCSAgICBwcmludGYo
IkZpbGVuYW1lIGNvbnRhaW5zIGludmFsaWQgY2hhcmFjdGVyc1xuIik7CisJICAgIGV4aXQoMSk7
CisJICB9CisKIAkvLyBDb3B5IGZpbGUgcGFyYW1ldGVycyBpbiB0aGUgc2VhcmNoX3JlYwogCVNl
YXJjaFJlY29yZC0+QXR0cmlidXRlcyA9IEVudHJ5LT5GaWxlQXR0cmlidXRlczsKIAlTZWFyY2hS
ZWNvcmQtPkZpbGVTaXplID0gRU5ESUFOX1NBRkUzMihFbnRyeS0+RmlsZVNpemUpOwo=
</data>        

          </attachment>
    </bug>

</bugzilla>