mirror of
https://github.com/gryf/wicd.git
synced 2026-03-10 11:35:49 +01:00
Fix CVE-2012-2095: local privilege escalation, setting arbitrary pre/post-connection scripts
This commit is contained in:
@@ -946,6 +946,28 @@ class WirelessDaemon(dbus.service.Object):
|
|||||||
self.LastScan = []
|
self.LastScan = []
|
||||||
self.config = ConfigManager(wireless_conf, debug=debug)
|
self.config = ConfigManager(wireless_conf, debug=debug)
|
||||||
|
|
||||||
|
self._validProperties = (
|
||||||
|
'bssid',
|
||||||
|
'essid',
|
||||||
|
'hidden',
|
||||||
|
'channel',
|
||||||
|
'mode',
|
||||||
|
'enctype',
|
||||||
|
'encryption_method',
|
||||||
|
'key',
|
||||||
|
'automatic',
|
||||||
|
'ip',
|
||||||
|
'netmask',
|
||||||
|
'broadcast',
|
||||||
|
'gateway',
|
||||||
|
'use_static_dns',
|
||||||
|
'use_global_dns',
|
||||||
|
'dns1',
|
||||||
|
'dns2',
|
||||||
|
'dns3',
|
||||||
|
'use_settings_globally',
|
||||||
|
)
|
||||||
|
|
||||||
def get_debug_mode(self):
|
def get_debug_mode(self):
|
||||||
return self._debug_mode
|
return self._debug_mode
|
||||||
def set_debug_mode(self, mode):
|
def set_debug_mode(self, mode):
|
||||||
@@ -1064,9 +1086,9 @@ class WirelessDaemon(dbus.service.Object):
|
|||||||
def SetWirelessProperty(self, netid, prop, value):
|
def SetWirelessProperty(self, netid, prop, value):
|
||||||
""" Sets property to value in network specified. """
|
""" Sets property to value in network specified. """
|
||||||
# We don't write script settings here.
|
# We don't write script settings here.
|
||||||
if (prop.strip()).endswith("script"):
|
if prop.strip() not in self._validProperties:
|
||||||
print "Setting script properties through the daemon is not" \
|
print "Trying to set invalid property (or property not " \
|
||||||
+ " permitted."
|
"permitted): "+ prop.strip() + "."
|
||||||
return False
|
return False
|
||||||
self.LastScan[netid][prop] = misc.to_unicode(misc.Noneify(value))
|
self.LastScan[netid][prop] = misc.to_unicode(misc.Noneify(value))
|
||||||
|
|
||||||
@@ -1355,6 +1377,25 @@ class WiredDaemon(dbus.service.Object):
|
|||||||
self.WiredNetwork = {}
|
self.WiredNetwork = {}
|
||||||
self.config = ConfigManager(wired_conf, debug=debug)
|
self.config = ConfigManager(wired_conf, debug=debug)
|
||||||
|
|
||||||
|
self._validProperties = (
|
||||||
|
'ip',
|
||||||
|
'broadcast',
|
||||||
|
'netmask',
|
||||||
|
'gateway',
|
||||||
|
'search_domain',
|
||||||
|
'dns_domain',
|
||||||
|
'dns1',
|
||||||
|
'dns2',
|
||||||
|
'dns3',
|
||||||
|
'encryption_enabled',
|
||||||
|
'default',
|
||||||
|
'dhcphostname',
|
||||||
|
'lastused',
|
||||||
|
'profilename',
|
||||||
|
'use_global_dns',
|
||||||
|
'use_static_dns',
|
||||||
|
)
|
||||||
|
|
||||||
def get_debug_mode(self):
|
def get_debug_mode(self):
|
||||||
return self._debug_mode
|
return self._debug_mode
|
||||||
def set_debug_mode(self, mode):
|
def set_debug_mode(self, mode):
|
||||||
@@ -1403,14 +1444,14 @@ class WiredDaemon(dbus.service.Object):
|
|||||||
return str(iface)
|
return str(iface)
|
||||||
|
|
||||||
@dbus.service.method('org.wicd.daemon.wired')
|
@dbus.service.method('org.wicd.daemon.wired')
|
||||||
def SetWiredProperty(self, property, value):
|
def SetWiredProperty(self, prop, value):
|
||||||
""" Sets the given property to the given value. """
|
""" Sets the given property to the given value. """
|
||||||
if self.WiredNetwork:
|
if self.WiredNetwork:
|
||||||
if (property.strip()).endswith("script"):
|
if prop.strip() not in self._validProperties:
|
||||||
print "Setting script properties through the daemon" \
|
print "Trying to set invalid property (or property not " \
|
||||||
+ " is not permitted."
|
"permitted): "+ prop.strip() + "."
|
||||||
return False
|
return False
|
||||||
self.WiredNetwork[property] = misc.to_unicode(misc.Noneify(value))
|
self.WiredNetwork[prop] = misc.to_unicode(misc.Noneify(value))
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print 'SetWiredProperty: WiredNetwork does not exist'
|
print 'SetWiredProperty: WiredNetwork does not exist'
|
||||||
|
|||||||
Reference in New Issue
Block a user