N°9379 - PHP unserialze function - security hardening

- Ensure shortcut doen't contain php objects, otherwise delete shortcut
This commit is contained in:
Benjamin DALSASS
2026-04-09 14:59:06 +02:00
parent a71fefa328
commit ddaf014898

View File

@@ -1546,7 +1546,16 @@ class ShortcutMenuNode extends MenuNode
public function GetHyperlink($aExtraParams)
{
$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'])) {
unset($aContext['menu']);
}