GHSA-V7M3-FPCR-H7M2
Vulnerability from github – Published: 2026-02-19 22:05 – Updated: 2026-02-19 22:05Description
The zumba/json-serializer library allows deserialization of PHP objects from JSON using a special @type field.
Prior to version 3.2.3, the deserializer would instantiate any class specified in the @type field without restriction. When processing untrusted JSON input, this behavior may allow an attacker to instantiate arbitrary classes available in the application.
If a vulnerable application passes attacker-controlled JSON into JsonSerializer::unserialize() and contains classes with dangerous magic methods (such as __wakeup() or __destruct()), this may lead to PHP Object Injection and potentially Remote Code Execution (RCE), depending on available gadget chains in the application or its dependencies.
This behavior is similar in risk profile to PHP's native unserialize() when used without the allowed_classes restriction.
Impact
This vulnerability allows instantiation of arbitrary PHP classes via the @type field when deserializing JSON.
Applications are impacted only if:
* Untrusted or attacker-controlled JSON is passed into JsonSerializer::unserialize(), and
* The application or its dependencies contain classes that can be leveraged as a gadget chain.
Successful exploitation may lead to: * Arbitrary code execution * Data exfiltration * File manipulation * Denial of service
Applications that only deserialize trusted data are not affected.
Patches
This issue is mitigated in version 3.2.3.
Version 3.2.3 introduces the method: setAllowedClasses(?array $allowedClasses)
This allows applications to restrict which classes may be instantiated during deserialization, similar to PHP's native unserialize() allowed_classes option.
Users should upgrade to version 3.2.3 or later and configure an appropriate class allowlist.
Workarounds
If upgrading is not immediately possible, applications should ensure that:
* JsonSerializer::unserialize() is never called on untrusted or attacker-controlled JSON.
* JSON input is validated and sanitized before deserialization.
* Object instantiation via @type is disabled in application logic where possible.
After upgrading, users can mitigate risk by explicitly configuring:
$serializer->setAllowedClasses([]);
to disable all object instantiation, or by providing a strict allowlist of safe classes.
References
- CWE-502: https://cwe.mitre.org/data/definitions/502.html
- PHP
unserialize()documentation: https://www.php.net/manual/en/function.unserialize.php - OWASP PHP Object Injection: https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "zumba/json-serializer"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.2.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-27206"
],
"database_specific": {
"cwe_ids": [
"CWE-502"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-19T22:05:40Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Description\n\nThe `zumba/json-serializer` library allows deserialization of PHP objects from JSON using a special `@type` field.\n\nPrior to version 3.2.3, the deserializer would instantiate any class specified in the `@type` field without restriction. When processing untrusted JSON input, this behavior may allow an attacker to instantiate arbitrary classes available in the application.\n\nIf a vulnerable application passes attacker-controlled JSON into JsonSerializer::unserialize() and contains classes with dangerous magic methods (such as `__wakeup()` or `__destruct()`), this may lead to PHP Object Injection and potentially Remote Code Execution (RCE), depending on available gadget chains in the application or its dependencies.\n\nThis behavior is similar in risk profile to PHP\u0027s native `unserialize()` when used without the `allowed_classes` restriction.\n\n### Impact\n\nThis vulnerability allows instantiation of arbitrary PHP classes via the `@type` field when deserializing JSON.\n\nApplications are impacted only if:\n* Untrusted or attacker-controlled JSON is passed into `JsonSerializer::unserialize()`, and\n* The application or its dependencies contain classes that can be leveraged as a gadget chain.\n\nSuccessful exploitation may lead to:\n* Arbitrary code execution\n* Data exfiltration\n* File manipulation\n* Denial of service\n\nApplications that only deserialize trusted data are not affected.\n\n### Patches\n\nThis issue is mitigated in version 3.2.3.\n\nVersion 3.2.3 introduces the method: `setAllowedClasses(?array $allowedClasses)`\n\nThis allows applications to restrict which classes may be instantiated during deserialization, similar to PHP\u0027s native `unserialize()` `allowed_classes` option.\n\nUsers should upgrade to version 3.2.3 or later and configure an appropriate class allowlist.\n\n### Workarounds\n\nIf upgrading is not immediately possible, applications should ensure that:\n* `JsonSerializer::unserialize()` is never called on untrusted or attacker-controlled JSON.\n* JSON input is validated and sanitized before deserialization.\n* Object instantiation via `@type` is disabled in application logic where possible.\n\nAfter upgrading, users can mitigate risk by explicitly configuring:\n\n```php\n$serializer-\u003esetAllowedClasses([]);\n```\n\nto disable all object instantiation, or by providing a strict allowlist of safe classes.\n\n### References\n\n* CWE-502: https://cwe.mitre.org/data/definitions/502.html\n* PHP `unserialize()` documentation: https://www.php.net/manual/en/function.unserialize.php\n* OWASP PHP Object Injection: https://owasp.org/www-community/vulnerabilities/PHP_Object_Injection",
"id": "GHSA-v7m3-fpcr-h7m2",
"modified": "2026-02-19T22:05:40Z",
"published": "2026-02-19T22:05:40Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/zumba/json-serializer/security/advisories/GHSA-v7m3-fpcr-h7m2"
},
{
"type": "WEB",
"url": "https://github.com/zumba/json-serializer/commit/bf26227879adefce75eb9651040d8982be97b881"
},
{
"type": "PACKAGE",
"url": "https://github.com/zumba/json-serializer"
},
{
"type": "WEB",
"url": "https://github.com/zumba/json-serializer/releases/tag/3.2.3"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Zumba Json Serializer has a potential PHP Object Injection via Unrestricted @type in unserialize()"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.