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.)
External Control of System or Configuration Setting
This vulnerability occurs when an application allows users to directly modify critical system settings or configuration values from an external source.
What is CWE-15?
Real-world CVEs caused by CWE-15
Aucune référence CVE publique n'est liée à ce CWE dans le catalogue MITRE pour le moment.
Parcours de l'attaquant étape par étape
- 1
The following C code accepts a number as one of its command line parameters and sets it as the host ID of the current machine.
- 2
Although a process must be privileged to successfully invoke sethostid(), unprivileged users may be able to invoke the program. The code in this example allows user input to directly control the value of a system setting. If an attacker provides a malicious value for host ID, the attacker can misidentify the affected machine on the network or cause other unintended behavior.
- 3
The following Java code snippet reads a string from an HttpServletRequest and sets it as the active catalog for a database Connection.
- 4
In this example, an attacker could cause an error by providing a nonexistent catalog name or connect to an unauthorized portion of the database.
Vulnerable C
The following C code accepts a number as one of its command line parameters and sets it as the host ID of the current machine.
...
sethostid(argv[1]);
... 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-15
- Architecture and Design Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
- Implementation / Architecture and Design Because setting manipulation covers a diverse set of functions, any attempt at illustrating it will inevitably be incomplete. Rather than searching for a tight-knit relationship between the functions addressed in the setting manipulation category, take a step back and consider the sorts of system values that an attacker should not be allowed to control.
- Implementation / Architecture and Design In general, do not allow user-provided or otherwise untrusted data to control sensitive values. The leverage that an attacker gains by controlling these values is not always immediately obvious, but do not underestimate the creativity of the attacker.
How to detect CWE-15
Plexicus détecte automatiquement CWE-15 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-15 ?
This vulnerability occurs when an application allows users to directly modify critical system settings or configuration values from an external source.
Quelle est la gravité de CWE-15 ?
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-15 ?
MITRE lists the following affected platforms: Not Technology-Specific, ICS/OT.
Comment puis-je prévenir CWE-15 ?
Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to…
Comment Plexicus détecte et corrige CWE-15 ?
Le moteur SAST de Plexicus reconnaît la signature de flux de données de CWE-15 à 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-15 ?
MITRE publie la définition canonique à https://cwe.mitre.org/data/definitions/15.html. Vous pouvez également consulter la documentation OWASP et NIST pour des conseils adjacents.
Weaknesses related to CWE-15
External Control of Critical State Data
This vulnerability occurs when an application stores security-sensitive state data in locations that unauthorized users can access and…
Untrusted Search Path
This vulnerability occurs when an application relies on an external search path, provided by a user or environment, to find and load…
External Control of Assumed-Immutable Web Parameter
This vulnerability occurs when a web application incorrectly trusts data that appears to be fixed or hidden from the user, such as values…
Reliance on Cookies without Validation and Integrity Checking
This vulnerability occurs when an application uses cookies to make security decisions—like granting access or changing settings—but fails…
External Control of File Name or Path
This vulnerability occurs when an application uses unvalidated user input to construct file or directory paths for filesystem operations.
Further reading
- MITRE — CWE-15 officiel https://cwe.mitre.org/data/definitions/15.html
- Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors https://samate.nist.gov/SSATTM_Content/papers/Seven%20Pernicious%20Kingdoms%20-%20Taxonomy%20of%20Sw%20Security%20Errors%20-%20Tsipenyuk%20-%20Chess%20-%20McGraw.pdf
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.