<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[After updating FOG to version 1.6.0.117, the Management Portal returns HTTP 500 Internal Server]]></title><description><![CDATA[<p dir="auto">Project: FOG Project<br />
Affected version: 1.6.0.117<br />
Branch: dev-branch<br />
Commit: 8b579c5cb<br />
OS: Oracle Linux Server<br />
PHP: 8.3.36<br />
Web server: Apache 2.4.37 / PHP-FPM<br />
Database: MariaDB 10.3<br />
Severity: High</p>
<p dir="auto">Problem Description</p>
<p dir="auto">After updating FOG to version 1.6.0.117, the Management Portal returns HTTP 500 Internal Server Error for some browser sessions.</p>
<p dir="auto">Apache, PHP-FPM and MariaDB are running correctly.</p>
<p dir="auto">Requests without the affected session return HTTP 200, indicating that the problem is associated with session handling rather than general web server availability.</p>
<p dir="auto">PHP Fatal Error</p>
<p dir="auto">PHP Fatal error:<br />
Uncaught Error: [] operator not supported for strings<br />
in FOGBase.php on line 1515</p>
<p dir="auto">Call sequence:</p>
<p dir="auto">FOGBase::setMessage()<br />
User::_isLoggedIn()<br />
User::isLoggedIn()<br />
Page::_isContentOnly()<br />
Page::__construct()<br />
management/index.php</p>
<p dir="auto">The error occurs when FOG attempts to queue a session-expiration notification.</p>
<p dir="auto">Root Cause</p>
<p dir="auto">File: packages/web/src/Base/FOGBase.php<br />
Method: FOGBase::setMessage()<br />
Line: 1515</p>
<p dir="auto">Current implementation:</p>
<p dir="auto">$_SESSION[‘FOG_MESSAGES’][] = [<br />
‘title’ =&gt; (string)$title,<br />
‘body’ =&gt; (string)$body,<br />
‘type’ =&gt; (string)$type<br />
];</p>
<p dir="auto">The implementation assumes that $_SESSION[‘FOG_MESSAGES’] is always an array.</p>
<p dir="auto">However, if the session variable contains a string, PHP throws a fatal error when the array append operator [] is used.</p>
<p dir="auto">The origin of the invalid string value has not yet been established.</p>
<p dir="auto">This is an application-level type-handling defect, not evidence that the installed PHP version is too old.</p>
<p dir="auto">Proposed Fix</p>
<p dir="auto">Validate and initialize the session message queue before appending new messages.</p>
<p dir="auto">public static function setMessage($body, $title = ‘’, $type = ‘info’)<br />
{<br />
if (session_status() !== PHP_SESSION_ACTIVE) {<br />
return;<br />
}</p>
<pre><code>if (!isset($_SESSION['FOG_MESSAGES'])
    || !is_array($_SESSION['FOG_MESSAGES'])
) {
    $_SESSION['FOG_MESSAGES'] = [];
}

$_SESSION['FOG_MESSAGES'][] = [
    'title' =&gt; (string)$title,
    'body' =&gt; (string)$body,
    'type' =&gt; (string)$type
];
</code></pre>
<p dir="auto">}</p>
<p dir="auto">This defensive check prevents fatal errors when the session message queue contains an unexpected type.</p>
<p dir="auto">Recommended Tests</p>
<p dir="auto">Missing FOG_MESSAGES session variable.</p>
<p dir="auto">FOG_MESSAGES contains a string.</p>
<p dir="auto">FOG_MESSAGES contains an empty array.</p>
<p dir="auto">FOG_MESSAGES contains previously queued messages.</p>
<p dir="auto">Multiple calls to setMessage().</p>
<p dir="auto">Expired sessions and login redirects.</p>
<p dir="auto">Compatibility with FOGBase::getMessage().</p>
<p dir="auto">PHP Version Considerations</p>
<p dir="auto">The issue was reproduced with PHP 8.3.36.</p>
<p dir="auto">Upgrading PHP is not expected to fix this defect because the application attempts to append an array element to a string.</p>
<p dir="auto">The proposed fix is compatible with PHP 8.3 and does not require a newer PHP release.</p>
<p dir="auto">Verification</p>
<p dir="auto">The installed FOGBase.php was compared with the corresponding file in the dev-branch repository. No differences were found.</p>
<p dir="auto">The PHP-FPM error log repeatedly recorded the fatal error during session expiration.</p>
<p dir="auto">Unauthenticated requests without the affected session returned HTTP 200.</p>
<p dir="auto">The proposed patch still requires regression testing.</p>
<p dir="auto">Expected Behavior</p>
<p dir="auto">FOG should handle invalid or expired sessions gracefully, without generating HTTP 500 errors.</p>
<p dir="auto">The message queue should be initialized safely, and the user should be redirected to the login screen or shown an appropriate session-expiration notification.</p>
<p dir="auto">Suggested Resolution</p>
<p dir="auto">Apply defensive session-type validation in FOGBase::setMessage() and review FOGBase::getMessage() for similar assumptions.</p>
<p dir="auto">Consider investigating where FOG_MESSAGES receives a string value to prevent the underlying state corruption.</p>
<p dir="auto">Suggested fix version: Next development build after 1.6.0.117, subject to maintainer approval.</p>
]]></description><link>http://forums.fogproject.org/topic/18308/after-updating-fog-to-version-1-6-0-117-the-management-portal-returns-http-500-internal-server</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Nov 2026 13:14:48 GMT</lastBuildDate><atom:link href="http://forums.fogproject.org/topic/18308.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 08 Nov 2026 12:09:13 GMT</pubDate><ttl>60</ttl></channel></rss>