1. CVE archive
  2. Vulnerability types
  3. CWE-495
CWE-495 · #745 most frequent type in the archive

Private Data Structure Returned From A Public Method

The product has a method that is declared public, but returns a reference to a private data structure, which could then be modified in unexpected ways.

Part of: CWE-668 · Exposure of Resource to Wrong Sphere

1CVEs of this type in the archive
0critical (CVSS ≥ 9)
0high severity (7–8.9)
Apr 1, 2025latest published

What it is

The product has a method that is declared public, but returns a reference to a private data structure, which could then be modified in unexpected ways.

Impact on systems

ScopeImpact
Integrity Modify Application Data
The contents of the data structure can be modified from outside the intended scope.

How to prevent it

Implementation Declare the method private.
Implementation Clone the member data and keep an unmodified version of the data private to the object.
Implementation Use public setter methods that govern how a private member can be modified.

Source: MITRE CWE catalog · Official entry on the MITRE website

All CWE-495 CVEs

1 results

Dottor Marc

Is this type of vulnerability in your systems?

An archive tells you what exists; a Vulnerability Assessment tells you what is exposed on your side. Dottor Marc tests your web applications and network with automated and manual checks.