Description
If an include file source is accessible, the file can contain usernames and passwords, as well as sensitive information pertaining to the application and system.
Potential Impact
Confidentiality
Read Application Data
Demonstrative Examples
<?php$dbName = 'usersDB';$dbPassword = 'skjdh#67nkjd3$3$';?><?phpinclude('database.inc');$db = connectToDB($dbName, $dbPassword);$db.authenticateUser($username, $password);?>Mitigations & Prevention
Do not store sensitive information in include files.
Protect include files from being exposed.
Related Weaknesses
Frequently Asked Questions
What is CWE-541?
CWE-541 (Inclusion of Sensitive Information in an Include File) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Variant-level weakness. If an include file source is accessible, the file can contain usernames and passwords, as well as sensitive information pertaining to the application and system.
How can CWE-541 be exploited?
Attackers can exploit CWE-541 (Inclusion of Sensitive Information in an Include File) to read application data. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-541?
Key mitigations include: Do not store sensitive information in include files.
What is the severity of CWE-541?
CWE-541 is classified as a Variant-level weakness (Low-Medium abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.