CWE WEAKNESSES / CWE-473
CWE-473
PHP External Variable Modification
Variant
What it is
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.
Impact
| Integrity | Modify Application Data |
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. D
Real-world CVE 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 weaknesses
Test & detect
Browse all common weaknesses, check related exploited CVEs, or map to ATT&CK techniques.
Source: MITRE CWE. View on cwe.mitre.org →