[UNIX] ekg Insecure Temporary Files Creation Vulnerability

SecuriTeam <[email protected]>
Newsgroups gmane.comp.security.securiteam
Message-ID <[email protected]>
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html 

- - - - - - - - -



  ekg Insecure Temporary Files Creation Vulnerability
------------------------------------------------------------------------


SUMMARY

 <http://dev.null.pl/ekg> ekg is "a Gadu-Gadu client". ekg creates 
temporary files in an insecure way, allowing local attackes to gain 
elevated privileges via a symblink attack.

DETAILS

Vulnerable Systems:
 * ekg versions released before 2005-06-05

The vulnerability is caused due to temporary files being created 
insecurely. This can be exploited via a symlink attack, and in turn create 
and/or overwrite arbitrary files with the privileges of the user running 
the affected script.

Vulnerable code:
In contrib/scripts/linki.py
95 def czyjest ():
96   if os.path.exists('/tmp/rmrmg_ekg_url'):
97     wejsc= open ('/tmp/rmrmg_ekg_url')
98     file = wejsc.readlines()
99     dlug=len(file)
100     wejsc.close()
101     #ekg.printf("generic", "liczno  %d" %(dlug))
102     return file
103   else:
104     return 0

Then
35 def handle_keypress(meta, key):
36   if key == 269:
37     ekg.printf("generic", "wci nieto F5")
38     nurl=czyjest()
39     if nurl == 0:
40       ekg.printf("generic", "nie ma zadnego adresu URL")
41     else:
42       dlug=len(nurl)
43       if dlug == 1:
44         ekg.printf("generic", "otwieram %s w nowej zak adce" 
%(nurl[0]))
45         os.system("MozillaFirebird -remote 'openURL(%s,new-tab)'" 
%(nurl[0]))
46         os.system('rm /tmp/rmrmg_ekg_url')
47       else:
48         ekg.printf("generic", "link w mam %d" %(dlug))
49         wielejest(nurl)
50         ekg.printf("generic", "otwieram %s w nowej zak adce" 
%(nurl[0]))
51         os.system("MozillaFirebird -remote 'openURL(%s, new-tab)'" 
%(nurl[0]))
52   elif key == 270:
53     ekg.printf("generic", "wcisni to F6")
54     nurl=czyjest()
55     if nurl == 0:
56       ekg.printf("generic", "nic nie moge skasowa - nie mazadnego 
adresu URL")
57     else:
58       dlug=len(nurl)
59       if dlug == 1:
60         ekg.printf("generic", "kasuje adres %s" %(nurl[0]))
61         os.system('rm /tmp/rmrmg_ekg_url')
62       else:
63         ekg.printf("generic", "jest wiele link w")
64         wielejest(nurl)
65         ekg.printf("generic", "kasuje pierwszy czyli: %s"%(nurl[0]))
66   elif key == 271:
67     ekg.printf("generic", "wcisni to F7")
68     nurl=czyjest()
69     if nurl == 0:
70       ekg.printf("generic", "nie ma zadnego adresu URL")
71     else:
72       dlug=len(nurl)
73       if dlug == 1:
74         ekg.printf("generic", "otwieram %s w nowym oknie"%(nurl[0]))
75         os.system("MozillaFirebird %s" %(nurl[0]))
76         os.system('rm /tmp/rmrmg_ekg_url')
77       else:
78         ekg.printf("generic", "link w mam %d" %(dlug))
79         wielejest(nurl)
80         ekg.printf("generic", "otwieram %s w nowym oknie"%(nurl[0]))
81   elif key == 272:
82     ekg.printf("generic", "wcisni to F8")
83     nurl=czyjest()
84     ekg.printf("generic", "F5 - otwiera w nowej zak adce; F7 wnowym 
oknie, a F6 kasuje, wszystko tyczy si pierwszej po zycji zlisty")
85     if nurl == 0:
86       ekg.printf("generic", "nie ma zadnego adresu URL")
87     else:
88       dlug=len(nurl)
89       ekg.printf("generic", "link w mam %d oto one:" %(dlug))
90       for po in nurl:
91         ekg.printf("generic", "%s" %(po))
92   return 1

CVE Information:
 <http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-1916> 
CAN-2005-1916


ADDITIONAL INFORMATION

The information has been provided by  <mailto:[email protected]> ZATAZ 
Audits.
The original article can be found at:  
<http://www.zataz.net/adviso/ekg-06062005.txt> 
http://www.zataz.net/adviso/ekg-06062005.txt
The original article can be found at:  
<http://bugs.gentoo.org/show_bug.cgi?id=94172> 
http://bugs.gentoo.org/show_bug.cgi?id=94172



======================================== 


This bulletin is sent to members of the SecuriTeam mailing list. 
To unsubscribe from the list, send mail with an empty subject line and body to: [email protected] 
In order to subscribe to the mailing list, simply forward this email to: [email protected] 


==================== 
==================== 

DISCLAIMER: 
The information in this bulletin is provided "AS IS" without warranty of any kind. 
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.