8000 security #cve-2019-10912 [Cache][PHPUnit Bridge] Prevent destructors … · symfony/cache@399ddbf · GitHub
[go: up one dir, main page]

Skip to content

Commit 399ddbf

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
1 parent 9d56206 commit 399ddbf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Traits/FilesystemCommonTrait.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ public static function throwError($type, $message, $file, $line)
116116
throw new \ErrorException($message, 0, $type, $file, $line);
117117
}
118118

119+
public function __sleep()
120+
{
121+
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
122+
}
123+
124+
public function __wakeup()
125+
{
126+
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
127+
}
128+
119129
public function __destruct()
120130
{
121131
if (method_exists(parent::class, '__destruct')) {

0 commit comments

Comments
 (0)
0