---
title: "CWE-9: J2EE Misconfiguration: Weak Access Permissions for EJB Methods"
url: https://radicalnotion.ai/cwe/cwe-9
type: cwe
description: "If elevated access rights are assigned to EJB methods, then an attacker can take advantage of the permissions to exploit the product."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-9: J2EE Misconfiguration: Weak Access Permissions for EJB Methods

- **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

If elevated access rights are assigned to EJB methods, then an attacker can take advantage of the permissions to exploit the product.

If the EJB deployment descriptor contains one or more method permissions that grant access to the special ANYONE role, it indicates that access control for the application has not been fully thought through or that the application is structured in such a way that reasonable access control restrictions are impossible.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | - |

## Applicable platforms

**Languages:** Java (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Other | Other | - |

## Potential mitigations

### Architecture and Design, System Configuration

Follow the principle of least privilege when assigning access rights to EJB methods. Permission to invoke EJB methods should not be granted to the ANYONE role.

## 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 deployment descriptor grants ANYONE permission to invoke the Employee EJB's method named getSalary().

Bad code:

```xml
<ejb-jar>
    ...
    <assembly-descriptor>
        <method-permission>
            <role-name>ANYONE</role-name>
            <method>
            <ejb-name>Employee</ejb-name>
            <method-name>getSalary</method-name>
        </method-permission>
    </assembly-descriptor>
    ...
</ejb-jar>
```

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-266](https://radicalnotion.ai/cwe/cwe-266) | Incorrect Privilege Assignment |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| 7 Pernicious Kingdoms | J2EE Misconfiguration: Weak Access Permissions | - | - |

## Frequently asked questions

### What is CWE-9?

If elevated access rights are assigned to EJB methods, then an attacker can take advantage of the permissions to exploit the product.

### How do you prevent CWE-9?

Follow the principle of least privilege when assigning access rights to EJB methods. Permission to invoke EJB methods should not be granted to the ANYONE role.

### How is CWE-9 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-9?

Exploiting CWE-9 can lead to: Other.

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

---

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