CWE
Home > CWE List > CWE- Individual Dictionary Definition (1.1)  
Search by ID:

CWE-607: Public Static Final Field References Mutable Object

Individual Definition in a New Window
Public Static Final Field References Mutable Object
Status: Draft
Weakness ID: 607 (Weakness Variant)
Description
Summary

A public or protected static final field references a mutable object, which allows the object to be changed by malicious code, or accidentally from another package

Potential Mitigations

Protect mutable objects by making them private. Restrict access to the getter and setter as well.

Demonstrative Examples

Here, an array (which is inherently mutable) is labeled public static final.

Java Example:
public static final String[] USER_ROLES;
Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfWeakness BaseWeakness BaseWeakness Base471Modification of Assumed-Immutable Data (MAID)
Development Concepts699
Research Concepts (primary)1000
ChildOfWeakness ClassWeakness ClassWeakness Class485Insufficient Encapsulation
Development Concepts (primary)699
Taxonomy Mappings
Mapped Taxonomy Name
Anonymous Tool Vendor (under NDA)
Applicable Platforms
Languages
Java
Time of Introduction
* Implementation
Content History
Submissions
Anonymous Tool Vendor (under NDA). (Externally Mined)
Modifications
Sean Eidemiller. Cigital. 2008-07-01. (External)
added/updated demonstrative examples
Eric Dalci. Cigital. 2008-07-01. (External)
updated Potential_Mitigations, Time_of_Introduction
CWE Content Team. MITRE. 2008-09-08. (Internal)
updated Relationships, Taxonomy_Mappings
Page Last Updated: November 24, 2008