CWEweakness

CWE-531 Inclusion of Sensitive Information in Test Code

Official page ↗
Abstraction
Variant
Structure
Simple
Status
Incomplete
Languages
Not Language-Specific
CWE version
5.0

Description

Accessible test applications can pose a variety of security risks. Since developers or administrators rarely consider that someone besides themselves would even know about the existence of these applications, it is common for them to contain sensitive information or functions.

Common consequences

• Confidentiality: Read Application Data

Potential mitigations

• [Distribution, Installation] Remove test code before deploying the application into production.

Detection methods

• Automated Static Analysis: 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.)

Related

Child of · CWE (1)

  • CWE-540 Inclusion of Sensitive Information in Source Code weakness

Referenced by CVE · weakness (2)

  • CVE-2024-42213 HCL BigFix Compliance is affected by inclusion of temporary files left in the production environment. vulnerability
  • CVE-2025-43717 In PEAR HTTP_Request2 before 2.7.0, multiple files in the tests directory, notably tests/_network/getparameters.php and… vulnerability