The product places sensitive information into files or directories that are accessible to actors who are allowed to have access to the files, but not to the sensitive information.
View on MITREDo not expose file and directory information to the user.
No detection method information available for this CWE.
In the following code snippet, a user's full name and credit card number are written to a log file.
No relationship information available for this CWE.
CWE-538: Insertion of Sensitive Information into Externally-Accessible File or Directory is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product places sensitive information into files or directories that are accessible to actors who are allowed to have access to the files, but not to the sensitive information.
If exploited, CWE-538 (Insertion of Sensitive Information into Externally-Accessible File or Directory) it can compromise Confidentiality, leading to outcomes such as Read Files or Directories.
Recommended mitigations for CWE-538 include: Do not expose file and directory information to the user.
CWE-538 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.
MITRE documents real CVEs mapped to CWE-538, including CVE-2018-1999036. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.
A CWE (Common Weakness Enumeration) like CWE-538 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.