[doc-en] master: `opcache_invalidate()`: Add a warning about untrusted input (#5871)

From: Date: Thu, 12 Nov 2026 14:26:50 +0000
Subject: [doc-en] master: `opcache_invalidate()`: Add a warning about untrusted input (#5871)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23942@lists.php.net to get a copy of this message
Author: Daniel Scherzer (DanielEScherzer) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-11-12T15:26:47+01:00 Commit: https://github.com/php/doc-en/commit/749f595e59ee938ea6507db19e41ca2575193e8b Raw diff: https://github.com/php/doc-en/commit/749f595e59ee938ea6507db19e41ca2575193e8b.diff opcache_invalidate(): Add a warning about untrusted input (#5871) * opcache_invalidate(): Add a warning about untrusted input Inputs are not validated for correctness and can escape the cache directory and remove other .bin files, including those that would otherwise be restricted by open_basedir. * Link to INI, copy edit Changed paths: M reference/opcache/functions/opcache-invalidate.xml Diff: diff --git a/reference/opcache/functions/opcache-invalidate.xml b/reference/opcache/functions/opcache-invalidate.xml index f8f5717381a7..60f7272af453 100644 --- a/reference/opcache/functions/opcache-invalidate.xml +++ b/reference/opcache/functions/opcache-invalidate.xml @@ -21,6 +21,20 @@ directive is enabled, this function also invalidates the corresponding file cache entry. </simpara> + <warning> + <simpara> + Avoid calling this function with untrusted input. When the + <link linkend="ini.opcache.file-cache">opcache.file_cache</link> directive + is enabled and + <link linkend="ini.opcache.file-cache-read-only">opcache.file_cache_read_only</link> + is not enabled, a <parameter>filename</parameter> that starts with + one or more <literal>../</literal> can escape from the opcache file cache + directory and allow deleting any file ending in <literal>.bin</literal> + that the user has permission to delete. This includes files to which + <link linkend="ini.open-basedir">open_basedir</link> might otherwise + limit access. + </simpara> + </warning> </refsect1> <refsect1 role="parameters">

« previous php.doc.cvs (#23942) next »