---
title: "CWE-473: PHP External Variable Modification"
url: https://radicalnotion.ai/cwe/cwe-473
type: cwe
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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-473: PHP External Variable Modification

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 3
- **Of those, in CISA KEV:** 2
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## 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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |

## Applicable platforms

**Languages:** PHP (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| 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 | Description |
| --- | --- |
| 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. |

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2023-36845 | Junos OS: EX and SRX Series: A PHP vulnerability in J-Web allows an unauthenticated to control an important environment variable | critical | 10.0 | - | Yes | 2023-08-17 |
| CVE-2023-36844 | Junos OS: EX Series: A PHP vulnerability in J-Web allows an unauthenticated attacker to control important environment variables | medium | 6.9 | - | Yes | 2023-08-17 |
| CVE-2024-27489 | - | high | 7.5 | - | No | 2024-07-19 |

## Related attack patterns (CAPEC)

- [CAPEC-77](https://radicalnotion.ai/capec/capec-77): Manipulating User-Controlled Variables

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-471](https://radicalnotion.ai/cwe/cwe-471) | Modification of Assumed-Immutable Data (MAID) |
| Peer | [CWE-616](https://radicalnotion.ai/cwe/cwe-616) | Incomplete Identification of Uploaded File Variables (PHP) |
| Can precede | [CWE-98](https://radicalnotion.ai/cwe/cwe-98) | Improper Control of Filename for Include/Require Statement in PHP Program |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | PHP External Variable Modification | - | - |

## Frequently asked questions

### What is CWE-473?

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.

### What CVEs are caused by CWE-473?

3 recorded CVEs are attributed to CWE-473, including CVE-2023-36845, CVE-2023-36844 and CVE-2024-27489. 2 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-473?

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.

### How is CWE-473 detected?

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.)

### What are the consequences of CWE-473?

Exploiting CWE-473 can lead to: Modify Application Data.

### Is CWE-473 actively exploited?

Yes. 2 CWE-473 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 3 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/473.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-473). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
