# Code Smell 322 - Request Data in Long-Lived Variables (PHP Vulnerability)

DevFeed: [Code Smell 322 - Request Data in Long-Lived Variables (PHP Vulnerability)](<https://devfeed.tech/articles/code-smell-322-request-data-in-long-lived-variables-php-vulnerability-93728.md>)

Original publisher: [Read original article](<https://maximilianocontieri.com/code-smell-322-request-data-in-long-lived-variables-php-vulnerability>)

Author: Maxi Contieri

Published: 2026-10-21T20:10:02Z

Content type: article

Language: en

Sources: [Maximiliano Contieri - Software Design](<https://devfeed.tech/sources/maximiliano-contieri-software-design.md>)

Topics: [PHP](<https://devfeed.tech/topics/php.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [code-execution](<https://devfeed.tech/tags/code-execution.md>), [code-smell](<https://devfeed.tech/tags/code-smell.md>), [code-smells](<https://devfeed.tech/tags/code-smells.md>), [cve-2026-109618](<https://devfeed.tech/tags/cve-2026-109618.md>), [cve-2026-109619](<https://devfeed.tech/tags/cve-2026-109619.md>), [php](<https://devfeed.tech/tags/php.md>), [php-vulnerability](<https://devfeed.tech/tags/php-vulnerability.md>), [request](<https://devfeed.tech/tags/request.md>), [variables](<https://devfeed.tech/tags/variables.md>), [vulnerability](<https://devfeed.tech/tags/vulnerability.md>)

## AI overview

Long-lived PHP worker state can retain a pointer to request-owned memory after the request ends; a later request may consume it before initialization, creating a use-after-free risk. Fatal errors, timeouts, memory exhaustion, or late diagnostic writes can bypass or undo normal resets, so the defect depends on both a stale-state write and a later read. The text recommends request-scoped ownership or explicit cleanup on every exit path, initialization before early consumers, blocking late updates, and consecutive-request tests that exercise failures, with tools such as AddressSanitizer, Valgrind, static analysis, and allocation-failure injection. It distinguishes this runtime-internals vulnerability from ordinary PHP globals, which do not automatically reproduce the CVE. The combined PHP patch resets vulnerable state and changes out-of-memory bailout handling; the article names PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35 as fixed releases. Confirmed exposure depends on SAPI, configuration, and affected state: it cites a demonstrated Apache mod_php path and documented PHP-FPM paths under specific conditions.

## Source excerpt

Your request is gone. Your pointer is not.