mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°9379 - PHP unserialze function - security hardening
- Ensure shortcut doen't contain php objects, otherwise delete shortcut
This commit is contained in:
@@ -1546,7 +1546,16 @@ class ShortcutMenuNode extends MenuNode
|
|||||||
public function GetHyperlink($aExtraParams)
|
public function GetHyperlink($aExtraParams)
|
||||||
{
|
{
|
||||||
$sContext = $this->oShortcut->Get('context');
|
$sContext = $this->oShortcut->Get('context');
|
||||||
$aContext = unserialize($sContext);
|
try {
|
||||||
|
$aContext = utils::Unserialize($sContext, ['allowed_classes' => false]);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
IssueLog::Warning("User shortcut corrupted, delete the shortcut", LogChannels::CONSOLE, [
|
||||||
|
'shortcut_name' => $this->oShortcut->GetName(),
|
||||||
|
'root_cause' => $e->getMessage(),
|
||||||
|
]);
|
||||||
|
// delete the shortcut
|
||||||
|
$this->oShortcut->DBDelete();
|
||||||
|
}
|
||||||
if (isset($aContext['menu'])) {
|
if (isset($aContext['menu'])) {
|
||||||
unset($aContext['menu']);
|
unset($aContext['menu']);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user