This vulnerability occurs when a class exposes a public method that directly accesses or alters a private variable.
Exposing a private variable through a public method breaks a core principle of encapsulation. It allows external code, including potential attacker-controlled inputs, to bypass intended controls and directly manipulate sensitive internal data. This can lead to the variable holding values the rest of the codebase never expects, corrupting the application's state and violating critical security assumptions. Beyond unexpected modification, this flaw can also lead to information disclosure. An attacker might use the public method to read the private variable's contents, potentially leaking sensitive data like internal flags, cryptographic keys, or user information. This exposed data not only compromises confidentiality but can also provide attackers with the insights needed to craft more sophisticated and targeted follow-up attacks.
Impact: Modify Application DataOther
c++java