CWE Database
/

CWE-540

Back to CWE list

CWE-540

Inclusion of Sensitive Information in Source Code

Base
Incomplete

Description

Source code on a web server or repository often contains sensitive information and should generally not be accessible to users.

There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.

Common Consequences

Scope

Confidentiality

Impact

Read Application Data

Potential Mitigations

Architecture and Design
System Configuration

Recommendations include removing this script from the web server and moving it to a location not accessible from the Internet.

CVE-2022-25512

Server for Team Awareness Kit (TAK) application includes sensitive tokens in the JavaScript source code.

CVE-2022-24867

The LDAP password might be visible in the html code of a rendered page in an IT Asset Management tool.

CVE-2007-6197

Version numbers and internal hostnames leaked in HTML comments.

Applicable Platforms

Not Language-Specific

Security Training

Train your team to recognize and prevent security threats with our comprehensive security awareness program.

Start Training

Vulnerability Scanning

Discover vulnerabilities in your applications and infrastructure before attackers do.

Scan Now