CWEweakness
CWE-473 PHP External Variable Modification
- Abstraction
- Variant
- Structure
- Simple
- Status
- Draft
- Languages
- PHP
- CWE version
- 5.0
Description
A PHP application does not properly protect against the modification of variables from external sources, such as query parameters or cookies. This can expose the application to numerous weaknesses that would not exist otherwise.
Common consequences
• Integrity: Modify Application Data
Potential mitigations
• [Requirements, Implementation] Carefully identify which variables can be controlled or influenced by an external user, and consider adopting a naming convention to emphasize when externally modifiable variables are being used. An application should be reluctant to trust variables that have been initialized outside of its trust boundary. Ensure adequate checking is performed when relying on input from outside a trust boundary. Do not allow your application to run with register_globals enabled. If you implement a register_globals emulator, be extremely careful of variable extraction, dynamic evaluation, and similar issues, since weaknesses in your emulation could allow external variable modification to take place even without register_globals.
Detection methods
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Observed examples
• CVE-2000-0860: File upload allows arbitrary file read by setting hidden form variables to match internal variable names.
• CVE-2001-0854: Mistakenly trusts $PHP_SELF variable to determine if include script was called by its parent.
• CVE-2002-0764: PHP remote file inclusion by modified assumed-immutable variable.
• CVE-2001-1025: Modify key variable when calling scripts that don't load a library that initializes it.
• CVE-2003-0754: Authentication bypass by modifying array used for authentication.
Related
Attack pattern · CAPEC (1)
- CAPEC-77 Manipulating User-Controlled Variables attack pattern
Observed example · CVE (5)
- CVE-2003-0754 nphpd.php in newsPHP 216 and earlier allows remote attackers to bypass authentication via an HTTP request with a modified nphp_users array,… vulnerability
- CVE-2002-0764 Phorum 3.3.2a allows remote attackers to execute arbitrary commands via an HTTP request to (1) plugin.php, (2) admin.php, or (3) del.php… vulnerability
- CVE-2001-0854 PHP-Nuke 5.2 allows remote attackers to copy and delete arbitrary files by calling case.filemanager.php with admin.php as an argument,… vulnerability
- CVE-2001-1025 PHP-Nuke 5.x allows remote attackers to perform arbitrary SQL operations by modifying the "prefix" variable when calling any scripts that… vulnerability
- CVE-2000-0860 The file upload capability in PHP versions 3 and 4 allows remote attackers to read arbitrary files by setting hidden form fields whose… vulnerability
Can precede · CWE (1)
- CWE-98 Improper Control of Filename for Include/Require Statement in PHP Program weakness
Child of · CWE (1)
- CWE-471 Modification of Assumed-Immutable Data (MAID) weakness
Referenced by CAPEC · weakness (1)
- CAPEC-77 Manipulating User-Controlled Variables attack pattern
Referenced by CVE · weakness (5)
- CVE-2026-40285 WeGIA is a web manager for charitable institutions. vulnerability
- CVE-2026-28411 WeGIA is a web manager for charitable institutions. vulnerability
- CVE-2024-27489 An issue in the DelFile() function of WMCMS v4.4 allows attackers to delete arbitrary files via a crafted POST request. vulnerability
- CVE-2023-36844 A PHP External Variable Modification vulnerability in J-Web of Juniper Networks Junos OS on EX Series allows an unauthenticated,… vulnerability
- CVE-2023-36845 A PHP External Variable Modification vulnerability in J-Web of Juniper Networks Junos OS on EX Series and SRX Series allows an… vulnerability
Referenced by CWE · peer of (1)
- CWE-616 Incomplete Identification of Uploaded File Variables (PHP) weakness