---
title: "CWE-582: Array Declared Public, Final, and Static"
url: https://radicalnotion.ai/cwe/cwe-582
type: cwe
description: "The product declares an array public, final, and static, which is not sufficient to prevent the array's contents from being modified."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-582: Array Declared Public, Final, and Static

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 0
- **Of those, in CISA KEV:** 0
- **New in 2026:** 0
- **CWE catalog version:** 4.21

## Description

The product declares an array public, final, and static, which is not sufficient to prevent the array's contents from being modified.

Because arrays are mutable objects, the final constraint requires that the array object itself be assigned only once, but makes no guarantees about the values of the array elements. Since the array is public, a malicious program can change the values stored in the array. As such, in most cases an array declared public, final and static is a bug.

## Background

Mobile code, in this case a Java Applet, is code that is transmitted across a network and executed on a remote machine. Because mobile code developers have little if any control of the environment in which their code will execute, special security concerns become relevant. One of the biggest environmental threats results from the risk that the mobile code will run side-by-side with other, potentially malicious, mobile code. Because all of the popular web browsers execute code from multiple sources together in the same JVM, many of the security guidelines for mobile code are focused on preventing manipulation of your objects' state and behavior by adversaries who have access to the same virtual machine where your product is running.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Languages:** Java (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity | Modify Application Data | - |

## Potential mitigations

### Implementation

In most situations the array should be made private.

## 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.)

## Demonstrative examples

### Example 1

The following Java Applet code mistakenly declares an array public, final and static.

Bad code:

```java
public final class urlTool extends Applet {
    public final static URL[] urls;
    ...
}
```

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-732](https://radicalnotion.ai/cwe/cwe-732) | Incorrect Permission Assignment for Critical Resource |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| The CERT Oracle Secure Coding Standard for Java (2011) | Do not use public static nonfinal variables | OBJ10-J | - |
| Software Fault Patterns | Unexpected Access Points | SFP28 | - |

## Frequently asked questions

### What is CWE-582?

The product declares an array public, final, and static, which is not sufficient to prevent the array's contents from being modified.

### How do you prevent CWE-582?

In most situations the array should be made private.

### How is CWE-582 detected?

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.)

### What are the consequences of CWE-582?

Exploiting CWE-582 can lead to: Modify Application Data.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/582.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-582). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
