Skip to content

Commit a43a2f6

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 71fb02e + ae40e4d commit a43a2f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Legacy/SymfonyTestsListenerTrait.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ public function __construct(array $mockedNamespaces = array())
8383
}
8484
}
8585

86+
public function __sleep()
87+
{
88+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
89+
}
90+
91+
public function __wakeup()
92+
{
93+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
94+
}
95+
8696
public function __destruct()
8797
{
8898
if (0 < $this->state) {

0 commit comments

Comments
 (0)