VYPR
Unrated severityNVD Advisory· Published Nov 1, 2005· Updated Jun 16, 2026

CVE-2005-3416

CVE-2005-3416

Description

phpBB 2.0.17 and earlier, when register_globals is enabled and the session_start function has not been called to handle a session, allows remote attackers to bypass security checks by setting the $_SESSION and $HTTP_SESSION_VARS variables to strings instead of arrays, which causes an array_merge function call to fail.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected products

28
  • PhpBB/phpBB28 versions
    cpe:2.3:a:phpbb_group:phpbb:2.0.0:*:*:*:*:*:*:*+ 27 more
    • cpe:2.3:a:phpbb_group:phpbb:2.0.0:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.1:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.10:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.11:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.12:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.13:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.14:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.15:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.16:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.17:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.2:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.3:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.4:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.5:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.6:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.6c:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.6d:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.7:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.7a:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.8:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.8a:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0.9:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0_beta1:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0_rc1:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0_rc2:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0_rc3:*:*:*:*:*:*:*
    • cpe:2.3:a:phpbb_group:phpbb:2.0_rc4:*:*:*:*:*:*:*
    • (no CPE)range: <=2.0.17

Patches

Vulnerability mechanics

Root cause

"Missing validation that $HTTP_SESSION_VARS is an array before passing it to array_merge() allows an attacker to set it to a string via register_globals, causing the deregistration routine to fail entirely."

Attack vector

An attacker sends a crafted HTTP request that sets the `$HTTP_SESSION_VARS` (or `$_SESSION`) global variable to a string value instead of an array. Because `session_start()` has not been called, PHP does not manage this variable, and with `register_globals` enabled the attacker can supply it via GET, POST, or COOKIE parameters. When the deregistration code calls `array_merge()` with this non-array argument, the function fails and returns an empty array, so the subsequent loop that unsets dangerous global variables never executes. This allows the attacker to then inject arbitrary global variables (such as those used in uninitialized variables elsewhere in phpBB) to achieve XSS, SQL injection, or remote code execution [ref_id=1].

Affected code

The vulnerable code is the register_globals deregistration routine in phpBB 2.0.17 and earlier. The advisory [ref_id=1] describes the logic: it calls `array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES)` and then unsets each global variable that is not in the `$not_unset` array. The flaw is that when `session_start()` has not been called, `$HTTP_SESSION_VARS` is not an array and can be set to a string by an attacker via register_globals, causing `array_merge` to fail and return an empty `$input` array, which bypasses the entire deregistration.

What the fix does

The advisory [ref_id=1] recommends upgrading to the new phpBB release (2.0.18 or later). No patch diff is provided in the bundle. The fix would need to ensure that `$HTTP_SESSION_VARS` is always initialized as an array before the `array_merge()` call, or that the deregistration code validates that each argument to `array_merge()` is actually an array before calling it, preventing the bypass when `session_start()` has not been called.

Preconditions

  • configPHP register_globals must be enabled
  • configsession_start() must not have been called before the deregistration code runs
  • networkAttacker must be able to send HTTP GET, POST, or COOKIE parameters

Generated on May 26, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

9

News mentions

0

No linked articles in our index yet.