CWE-495
Weakness AllowedPrivate Data Structure Returned From A Public Method
Abstraction: Variant · Status: Draft
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.
Mapping guidance
This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Modes of introduction
Detection methods
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High
Content history
added/updated demonstrative examples
updated Time_of_Introduction
added/updated white box definitions
updated Applicable_Platforms, Relationships, Taxonomy_Mappings
updated Common_Consequences
updated Common_Consequences, Relationships
updated Potential_Mitigations
updated Relationships, Taxonomy_Mappings
updated Relationships, White_Box_Definitions
updated Common_Consequences, Demonstrative_Examples, Description, Name, Potential_Mitigations
updated References, Relationships
updated Detection_Factors, Relationships
updated Mapping_Notes
updated Applicable_Platforms, Weakness_Ordinalities
updated References, Relationships
1 vulnerability references this CWE, most recent first.
CVE-2025-29868 (GCVE-0-2025-29868)
Vulnerability from cvelistv5 – Published: 2025-04-01 07:56 – Updated: 2025-04-10 15:03- CWE-495 - Private Data Structure Returned From A Public Method
| Vendor | Product | Version | |
|---|---|---|---|
| Apache Software Foundation | Apache Answer |
Affected:
0 , ≤ 1.4.2
(semver)
|
{
"containers": {
"adp": [
{
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "NONE",
"baseScore": 6.5,
"baseSeverity": "MEDIUM",
"confidentialityImpact": "LOW",
"integrityImpact": "LOW",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N",
"version": "3.1"
}
},
{
"other": {
"content": {
"id": "CVE-2025-29868",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2025-04-01T18:43:08.062075Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2025-04-01T18:43:33.714Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
},
{
"providerMetadata": {
"dateUpdated": "2025-04-10T15:03:07.021Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"url": "http://www.openwall.com/lists/oss-security/2025/04/01/2"
},
{
"url": "http://www.openwall.com/lists/oss-security/2025/04/02/1"
},
{
"url": "http://www.openwall.com/lists/oss-security/2025/04/10/3"
}
],
"title": "CVE Program Container"
}
],
"cna": {
"affected": [
{
"defaultStatus": "unaffected",
"product": "Apache Answer",
"vendor": "Apache Software Foundation",
"versions": [
{
"lessThanOrEqual": "1.4.2",
"status": "affected",
"version": "0",
"versionType": "semver"
}
]
}
],
"credits": [
{
"lang": "en",
"type": "reporter",
"value": "Hamed Kohi"
},
{
"lang": "en",
"type": "reporter",
"value": "Luke Smith"
}
],
"descriptions": [
{
"lang": "en",
"supportingMedia": [
{
"base64": false,
"type": "text/html",
"value": "\u003cp\u003ePrivate Data Structure Returned From A Public Method vulnerability in Apache Answer.\u003c/p\u003e\u003cp\u003eThis issue affects Apache Answer: through 1.4.2.\u003c/p\u003eIf a user uses an externally referenced image, when a user accesses this image, the provider of the image may obtain private information about the ip address of that accessing user.\u003cbr\u003e\u003cp\u003eUsers are recommended to upgrade to version 1.4.5, which fixes the issue.\u0026nbsp;In the new version, administrators can set whether external content can be displayed.\u003c/p\u003e"
}
],
"value": "Private Data Structure Returned From A Public Method vulnerability in Apache Answer.\n\nThis issue affects Apache Answer: through 1.4.2.\n\nIf a user uses an externally referenced image, when a user accesses this image, the provider of the image may obtain private information about the ip address of that accessing user.\nUsers are recommended to upgrade to version 1.4.5, which fixes the issue.\u00a0In the new version, administrators can set whether external content can be displayed."
}
],
"metrics": [
{
"other": {
"content": {
"text": "low"
},
"type": "Textual description of severity"
}
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-495",
"description": "CWE-495 Private Data Structure Returned From A Public Method",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2025-04-01T07:56:28.633Z",
"orgId": "f0158376-9dc2-43b6-827c-5f631a4d8d09",
"shortName": "apache"
},
"references": [
{
"tags": [
"vendor-advisory"
],
"url": "https://lists.apache.org/thread/l7pohw5g03g3qsvrz8pqc9t29mdv5lhf"
}
],
"source": {
"discovery": "EXTERNAL"
},
"title": "Apache Answer: Using externally referenced images can leak user privacy.",
"x_generator": {
"engine": "Vulnogram 0.2.0"
}
}
},
"cveMetadata": {
"assignerOrgId": "f0158376-9dc2-43b6-827c-5f631a4d8d09",
"assignerShortName": "apache",
"cveId": "CVE-2025-29868",
"datePublished": "2025-04-01T07:56:28.633Z",
"dateReserved": "2025-03-12T07:04:55.206Z",
"dateUpdated": "2025-04-10T15:03:07.021Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
Mitigation
Declare the method private.
Mitigation
Clone the member data and keep an unmodified version of the data private to the object.
Mitigation
Use public setter methods that govern how a private member can be modified.
No CAPEC attack patterns related to this CWE.