This vulnerability occurs when a critical piece of data—like a variable, field, or class member—is mistakenly declared as public when it should be kept private according to the application's security design.
Declaring sensitive data as public breaks fundamental security principles like encapsulation and least privilege. It directly exposes critical information, such as internal state, configuration secrets, or authentication tokens, to any other part of the codebase or, in some languages and contexts, to external actors. This creates a clear and immediate attack surface, making it trivial for an attacker to read or modify data that should be strictly controlled. Beyond the direct security flaw, this practice severely damages code maintainability and security hygiene. It becomes difficult to track how and where this critical data is being used or altered, scattering logic that should be centralized. This "spaghetti code" effect makes identifying the root cause of bugs or vulnerabilities more time-consuming and increases the risk of introducing new security weaknesses during future development or refactoring.
Impact: Read Application DataModify Application Data
Making a critical variable public allows anyone with access to the object in which the variable is contained to alter or read the value.
Impact: Reduce Maintainability
c++c++c++
// if the username and password in the input parameters are equal to*
c++
c++c++