VDB
Sign up
HIGH8.9

GHSA-699q-wcff-g9mj

Unsafe deserialization in Yii 2

Quick fix

GHSA-699q-wcff-g9mj — yiisoft/yii2: upgrade to the fixed version with the command below.

composer require yiisoft/yii2:^2.0.38

Details

### Impact

Remote code execution in case application calls `unserialize()` on user input containing specially crafted string.

### Patches

2.0.38

### Workarounds

Add the following to BatchQueryResult.php:

```php public function __sleep() { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); }

public function __wakeup() { throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); } ```

### For more information

If you have any questions or comments about this advisory, [contact us through security form](https://www.yiiframework.com/security).

Are you affected?

Enter the version of the package you're using.

Affected packages

Packagist/yiisoft/yii2
Introduced in: 0Fixed in: 2.0.38
Fixcomposer require yiisoft/yii2:^2.0.38

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:composer/yiisoft/yii2"]}'