Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4cc37df

Browse files
security #cve-2019-18889 [Cache] forbid serializing AbstractAdapter and TagAwareAdapter instances (nicolas-grekas)
This PR was merged into the 3.4 branch.
2 parents b21025b + 1507413 commit 4cc37df

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/Symfony/Component/Cache/Adapter/AbstractAdapter.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,16 @@ public function commit()
275275
return $ok;
276276
}
277277

278+
public function __sleep()
279+
{
280+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
281+
}
282+
283+
public function __wakeup()
284+
{
285+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
286+
}
287+
278288
public function __destruct()
279289
{
280290
if ($this->deferred) {

src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,16 @@ public function commit()
282282
return $this->invalidateTags([]);
283283
}
284284

285+
public function __sleep()
286+
{
287+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
288+
}
289+
290+
public function __wakeup()
291+
{
292+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
293+
}
294+
285295
public function __destruct()
286296
{
287297
$this->commit();

0 commit comments

Comments
 (0)