CWE-496: Public Data Assigned to Private Array-Typed Field

VariantIncomplete

Assigning public data to a private array is equivalent to giving public access to the array.

View on MITRE
Back to CWE Lookup

Technical Details

Structure
Simple

Applicable To

Languages
CC++JavaC#
Platforms

Frequently Asked Questions

What is CWE-496: Public Data Assigned to Private Array-Typed Field?+

CWE-496: Public Data Assigned to Private Array-Typed Field is a Common Weakness Enumeration (CWE) entry maintained by MITRE. Assigning public data to a private array is equivalent to giving public access to the array.

What are the security consequences of Public Data Assigned to Private Array-Typed Field?+

If exploited, CWE-496 (Public Data Assigned to Private Array-Typed Field) it can compromise Integrity, leading to outcomes such as Modify Application Data.

How do you prevent or mitigate Public Data Assigned to Private Array-Typed Field?+

Recommended mitigations for CWE-496 include: Do not allow objects to modify private members of a class.

Which programming languages are affected by Public Data Assigned to Private Array-Typed Field?+

CWE-496 commonly affects C, C++, Java and C#. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-496 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More