CWE-454 Base Draft

External Initialization of Trusted Variables or Data Stores

This vulnerability occurs when an application sets up its critical internal variables or storage systems using data from untrusted, external sources that an attacker could control.

Definition

What is CWE-454?

This vulnerability occurs when an application sets up its critical internal variables or storage systems using data from untrusted, external sources that an attacker could control.
A secure system should be cautious about trusting any data that originates from outside its own controlled environment. When core application variables or data stores—like configuration flags, security tokens, or internal state trackers—are populated with user-supplied or externally-provided values, attackers can feed them malicious data. This allows them to manipulate the application's logic from the very start, often leading to severe security breaches. In practice, this means developers must ensure that all trusted variables are initialized with hard-coded values, secure internal processes, or rigorously validated data. Relying on external inputs for initialization, even if those inputs are later checked, creates a dangerous window where the system's foundational state is compromised. Always establish critical internal state independently, before processing any untrusted data.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-454

  • WordPress module sets internal variables based on external inputs, allowing false reporting of the number of views

  • Does not clear dangerous environment variables, enabling symlink attack.

  • Specify alternate configuration directory in environment variable, enabling untrusted path.

  • Dangerous environment variable not cleansed.

  • Specify arbitrary modules using environment variable.

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    In the Java example below, a system property controls the debug level of the application.

  2. 2

    If an attacker is able to modify the system property, then it may be possible to coax the application into divulging sensitive information by virtue of the fact that additional debug information is printed/exposed as the debug level increases.

  3. 3

    This code checks the HTTP POST request for a debug switch, and enables a debug mode if the switch is set.

  4. 4

    Any user can activate the debug mode, gaining administrator privileges. An attacker may also use the information printed by the phpinfo() function to further exploit the system. .

  5. 5

    This example also exhibits Information Exposure Through Debug Information (CWE-215)

Verwundbares Codebeispiel

Vulnerable Java

In the Java example below, a system property controls the debug level of the application.

Verwundbar Java
int debugLevel = Integer.getInteger("com.domain.application.debugLevel").intValue();
Sicheres Codebeispiel

Secure pseudo

Sicher pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
  const safe = validateAndEscape(input);
  return executeWithGuards(safe);
}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Präventions-Checkliste

How to prevent CWE-454

  • Implementation A product system should be reluctant to trust variables that have been initialized outside of its trust boundary. Ensure adequate checking (e.g. input validation) is performed when relying on input from outside a trust boundary.
  • Architecture and Design Avoid any external control of variables. If necessary, restrict the variables that can be modified using an allowlist, and use a different namespace or naming convention if possible.
Erkennungssignale

How to detect CWE-454

SAST High

Führe statische Analyse (SAST) auf der Codebasis aus und suche im Datenfluss nach dem unsicheren Muster.

DAST Moderate

Führe dynamische Application-Security-Tests gegen den Live-Endpoint aus.

Runtime Moderate

Beobachte Runtime-Logs auf ungewöhnliche Exception-Traces, fehlerhafte Eingaben oder Versuche, Autorisierung zu umgehen.

Code review Moderate

Code Review: Markiere jeden neuen Code, der Eingaben von dieser Oberfläche ohne validierte Framework-Helper verarbeitet.

Plexicus Auto-Fix

Plexicus erkennt CWE-454 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.

Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.

Häufig gestellte Fragen

Frequently asked questions

Was ist CWE-454?

This vulnerability occurs when an application sets up its critical internal variables or storage systems using data from untrusted, external sources that an attacker could control.

Wie gravierend ist CWE-454?

MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.

Welche Sprachen oder Plattformen sind von CWE-454 betroffen?

MITRE lists the following affected platforms: PHP.

Wie kann ich CWE-454 verhindern?

A product system should be reluctant to trust variables that have been initialized outside of its trust boundary. Ensure adequate checking (e.g. input validation) is performed when relying on input from outside a trust boundary. Avoid any external control of variables. If necessary, restrict the variables that can be modified using an allowlist, and use a different namespace or naming convention if possible.

Wie erkennt und behebt Plexicus CWE-454?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-454 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.

Wo erfahre ich mehr über CWE-454?

MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/454.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.

Bereit, wenn du es bist

Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.

Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.