php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80588 opcache causes include() to include an utterly random unrelated file
Submitted: 2021-01-04 18:44 UTC Modified: 2021-02-23 11:56 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: php4fan at gmail dot com Assigned:
Status: Open Package: opcache
PHP Version: 7.4.13 OS: linux debian 9
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-01-04 18:44 UTC] php4fan at gmail dot com
Description:
------------
In my code I have the following code executed many times:

<?php
eval("
   include("/path/to/a/file_1.php");
");
?>

It is not as direct as that: the evaled string is fetched from a db rather than being a literal, but it's fixed as the above.

Under some apparently random circumstances, at the Nth time that gets executed, it executes a completely unrelated file /path/to/another/file_2.php instead of the one whose name is being passed to include().

Disabling opcache fixes the issue.

I haven't been able to recreate a minimal, sharable, reproducible test case. With my code it happens systematically 100% of the time that this given script is executed.

It looks almost as if, because of a hash collision or something of that sort (uttelry random but at the same time 100% reproducible), the opcache ended up fetching a completely unrelated precompiled piece of bytecode.


This is a REGRESSION, it happens with PHP 7.4.11 but not with PHP 5.6


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-23 11:47 UTC] php4fan at gmail dot com
Why is this being ignored? The impact of this is devastating.
 [2021-02-23 11:56 UTC] nikic@php.net
It's unlikely this can be addressed without a way to reproduce this issue.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Jul 29 02:01:22 2021 UTC