CWE-607

Public Static Final Field References Mutable Object
AI Translation Available

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.

Status
draft
Abstraction
variant
Java

Common Consequences

integrity
Impacts
modify application data

Detection Methods

automated static analysis

Potential Mitigations

Phases:
implementation
Descriptions:
• Protect mutable objects by making them private. Restrict access to the getter and setter as well.