Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/private/TaskProcessing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,17 @@ public function getAvailableTaskTypes(bool $showDisabled = false, ?string $userI
if ($this->availableTaskTypes === null) {
$cachedValue = $this->distributedCache->get($cacheKey);
if ($cachedValue !== null) {
$this->availableTaskTypes = unserialize($cachedValue);
// Restrict deserialization to the exact value-object classes stored in
// this cache entry. Bare unserialize() would allow an attacker who
// can write to the distributed cache backend to trigger PHP Object
// Injection via arbitrary gadget chains loaded in the process.
$this->availableTaskTypes = unserialize($cachedValue, [
'allowed_classes' => [
ShapeDescriptor::class,
ShapeEnumValue::class,
EShapeType::class,
],
]);
}
}
// Either we have no cache or showDisabled is turned on, which we don't want to cache, ever.
Expand Down