Skip to content

Commit c31a91b

Browse files
security #cve-2019-10912 [Cache][PHPUnit Bridge] Prevent destructors with side-effects from being unserialized (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Cache][PHPUnit Bridge] Prevent destructors with side-effects from being unserialized | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Reported for `FilesystemCommonTrait` at https://www.intigriti.com/company/submission/CfDJ8Pja6NZvkpNCmx5vVyiGSn7yW8c1j4H0-cnAhIk6fbstOMm028X-XD1kmSuQkGB2n0cRyyVrA2yAiLN_I0EVilaKVLSiSa0UXZJGfN1h85vmk5c2dBBpu619r1YQEIjcXA Commits ------- 4fb9752816 Prevent destructors with side-effects from being unserialized
2 parents 36c3c81 + 1959c82 commit c31a91b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Tests/Kernel/ConcreteMicroKernel.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ public function getLogDir()
6464
return $this->cacheDir;
6565
}
6666

67+
public function __sleep()
68+
{
69+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
70+
}
71+
72+
public function __wakeup()
73+
{
74+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
75+
}
76+
6777
public function __destruct()
6878
{
6979
$fs = new Filesystem();

0 commit comments

Comments
 (0)