---
title: "CWE-536: Servlet Runtime Error Message Containing Sensitive Information"
url: https://radicalnotion.ai/cwe/cwe-536
type: cwe
description: "A servlet error message indicates that there exists an unhandled exception in the web application code and may provide useful information to an attacker."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-536: Servlet Runtime Error Message Containing Sensitive Information

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

## Description

A servlet error message indicates that there exists an unhandled exception in the web application code and may provide useful information to an attacker.

## Modes of introduction

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

## Applicable platforms

**Languages:** Java (Undetermined)

**Technologies:** Web Based (Undetermined), Web Server (Undetermined)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality | Read Application Data | The error message may contain the location of the file in which the offending function is located. This may disclose the web root's absolute path as well as give the attacker the location of application files or configuration information. It may even disclose the portion of code that failed. In many cases, an attacker can use the data to launch further attacks against the system. |

## Demonstrative examples

### Example 1

The following servlet code does not catch runtime exceptions, meaning that if such an exception were to occur, the container may display potentially dangerous information (such as a full stack trace).

Bad code:

```java
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String username = request.getParameter("username");

    // May cause unchecked NullPointerException.
    if (username.length() < 10) {
        ...
    }
}
```

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-211](https://radicalnotion.ai/cwe/cwe-211) | Externally-Generated Error Message Containing Sensitive Information |

## Frequently asked questions

### What is CWE-536?

A servlet error message indicates that there exists an unhandled exception in the web application code and may provide useful information to an attacker.

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

Exploiting CWE-536 can lead to: Read Application Data.

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

---

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