CWEweakness

CWE-767 Access to Critical Private Variable via Public Method

Official page ↗
Abstraction
Variant
Structure
Simple
Status
Incomplete
Languages
C#, C++, Java
CWE version
5.0

Description

The product defines a public method that reads or modifies a private variable.

Common consequences

• Integrity, Other: Modify Application Data, Varies by Context — If an attacker modifies the variable to contain unexpected values, this could violate assumptions from other parts of the code. Additionally, if an attacker can read the private variable, it may expose sensitive information or make it easier to launch further attacks.

Potential mitigations

• [Implementation] Use class accessor and mutator methods appropriately. Perform validation when accepting data from a public method that is intended to modify a critical private variable. Also be sure that appropriate access controls are being applied when a public method interfaces with critical data.

Related

Child of · CWE (1)

  • CWE-668 Exposure of Resource to Wrong Sphere weakness

Referenced by CVE · weakness (4)

  • CVE-2024-34162 The web interface of the affected devices is designed to hide the LDAP credentials even for administrative users. vulnerability
  • CVE-2024-36463 The implementation of atob in "Zabbix JS" allows to create a string with arbitrary content and use it to access internal properties of… vulnerability
  • CVE-2020-26868 ARC Informatique PcVue prior to version 12.0.17 is vulnerable to a denial-of-service attack due to the ability of an unauthorized user to… vulnerability
  • CVE-2016-8380 The web server in Phoenix Contact ILC PLCs allows access to read and write PLC variables without authentication. vulnerability