-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserialization of untrusted data #7
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,11 @@ public function create($mailbox) | |
$mailbox = IMP_Mailbox::get($mailbox); | ||
|
||
if ($ob = $this->_getCache($mailbox)->get($key)) { | ||
$ob = @unserialize($ob); | ||
$ob = @unserialize($ob, array('allowed_classes' => array( | ||
'IMP_Mailbox_List_Virtual', | ||
'IMP_Mailbox_List_Pop3', | ||
'IMP_Mailbox_List', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to include |
||
))); | ||
} | ||
|
||
if (!$ob) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,16 @@ public function __construct() | |
} | ||
|
||
if ($f_list = $GLOBALS['prefs']->getValue('msgflags')) { | ||
$f_list = @unserialize($f_list); | ||
$f_list = @unserialize($f_list, array('allowed_classes' => array( | ||
'IMP_Flag_Imap_Answered', | ||
'IMP_Flag_Imap_Deleted', | ||
'IMP_Flag_Imap_Draft', | ||
'IMP_Flag_Imap_Flagged', | ||
'IMP_Flag_Imap_Forwarded', | ||
'IMP_Flag_Imap_Junk', | ||
'IMP_Flag_Imap_NotJunk', | ||
'IMP_Flag_Imap_Seen', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to include |
||
))); | ||
if (is_array($f_list)) { | ||
foreach ($f_list as $val) { | ||
$this->_userflags[$val->id] = $val; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -344,7 +344,10 @@ protected function _upgradeVirtualFolders() | |
|
||
$vfolders = $prefs->getValue('vfolder'); | ||
if (!empty($vfolders)) { | ||
$vfolders = @unserialize($vfolders); | ||
$vfolders = @unserialize($vfolders, array('allowed_classes' => array( | ||
'IMP_Search_Vfolder_Vinbox', | ||
'IMP_Search_Vfolder_Vtrash', | ||
))); | ||
} | ||
|
||
if (empty($vfolders) || !is_array($vfolders)) { | ||
|
@@ -577,7 +580,7 @@ protected function _upgradeStationeryToTemplates() | |
{ | ||
global $injector, $prefs; | ||
|
||
$slist = @unserialize($prefs->getValue('stationery')); | ||
$slist = @unserialize($prefs->getValue('stationery'), array('allowed_classes' => false)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have a deprecation policy, when this property can be removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is already removed, as a settable preference. We don't remove migrations though. |
||
if (is_array($slist)) { | ||
/* Old entry format: | ||
* 'c' => (string) Content | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find a way to set a value of this preference. Is it used available anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an advanced preference in the "Compose" preference group.