Exécuter une analyse statique (SAST) sur le code source à la recherche du motif non sécurisé dans le flux de données.
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.
What is CWE-454?
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.
Parcours de l'attaquant étape par étape
- 1
In the Java example below, a system property controls the debug level of the application.
- 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
This code checks the HTTP POST request for a debug switch, and enables a debug mode if the switch is set.
- 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
This example also exhibits Information Exposure Through Debug Information (CWE-215)
Vulnerable Java
In the Java example below, a system property controls the debug level of the application.
int debugLevel = Integer.getInteger("com.domain.application.debugLevel").intValue(); Secure pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
const safe = validateAndEscape(input);
return executeWithGuards(safe);
} 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.
How to detect CWE-454
Exécuter des tests de sécurité applicative dynamique (DAST) contre le point de terminaison en ligne.
Surveiller les journaux runtime pour détecter des traces d'exception inhabituelles, des entrées malformées ou des tentatives de contournement d'autorisation.
Revue de code : signaler tout nouveau code qui traite les entrées de cette surface sans utiliser les helpers du framework validés.
Plexicus détecte automatiquement CWE-454 et ouvre une PR de correction en moins de 60 secondes.
Codex Remedium analyse chaque commit, identifie cette faiblesse précise et livre une pull request prête à être relue avec le correctif. Pas de tickets. Pas de transferts.
Frequently asked questions
Qu'est-ce que 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.
Quelle est la gravité de CWE-454 ?
MITRE n'a pas publié de note de probabilité d'exploitation pour cette faiblesse. Traitez-la comme un impact moyen jusqu'à ce que votre modèle de menace prouve le contraire.
Quels langages ou plateformes sont affectés par CWE-454 ?
MITRE lists the following affected platforms: PHP.
Comment puis-je prévenir CWE-454 ?
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.
Comment Plexicus détecte et corrige CWE-454 ?
Le moteur SAST de Plexicus reconnaît la signature de flux de données de CWE-454 à chaque commit. Lorsqu'une correspondance est trouvée, notre agent Codex Remedium ouvre une PR de correction avec le code corrigé, les tests et un résumé d'une ligne pour le relecteur.
Où puis-je en savoir plus sur CWE-454 ?
MITRE publie la définition canonique à https://cwe.mitre.org/data/definitions/454.html. Vous pouvez également consulter la documentation OWASP et NIST pour des conseils adjacents.
Weaknesses related to CWE-454
Incorrect Initialization of Resource
This weakness occurs when a system fails to properly set up a resource during its creation, leaving it in an unstable, incorrect, or…
Initialization with Hard-Coded Network Resource Configuration Data
This vulnerability occurs when software uses fixed, hard-coded values—like IP addresses, domain names, or URLs—to identify network…
Excessive Use of Hard-Coded Literals in Initialization
This weakness occurs when software initializes variables or data structures using hard-coded values (like strings, file paths, or network…
Initialization of a Resource with an Insecure Default
This vulnerability occurs when software uses an insecure default setting or value for a resource, assuming an administrator will change it…
Incorrect Register Defaults or Module Parameters
This vulnerability occurs when hardware description language (HDL) code sets insecure default values for hardware registers or…
Missing Initialization of a Variable
This vulnerability occurs when a program uses a variable before giving it a starting value, causing the software to rely on unpredictable…
Arrêtez de payer par développeur.
Commencez à fermer la boucle.
Plexicus est l'ASPM natif IA qui scanne, filtre, corrige, penteste et explique — de façon autonome. Développeurs illimités, dépôts illimités, actions IA à usage équitable. Vrai niveau gratuit, €269/mo annuel quand vous êtes prêt.