CWE-382: J2EE Bad Practices: Use of System.exit()

Export to Word

Description

A J2EE application uses System.exit(), which also shuts down its container.

Extended Description

It is never a good idea for a web application to attempt to shut down the application container. Access to a function that can shut down the application is an avenue for Denial of Service (DoS) attacks.


ThreatScore

Threat Mapped score: 1.5

Industry: Finiancial

Threat priority: P4 - Informational (Low)


Observed Examples (CVEs)

Related Attack Patterns (CAPEC)

N/A


Attack TTPs

N/A

Modes of Introduction

Phase Note
Implementation A call to System.exit() is probably part of leftover debug code or code imported from a non-J2EE application.

Common Consequences

Potential Mitigations

Applicable Platforms


Demonstrative Examples

Intro: Included in the doPost() method defined below is a call to System.exit() in the event of a specific exception.

Public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { ... } catch (ApplicationSpecificException ase) { logger.error("Caught: " + ase.toString()); System.exit(1); } }

Notes

← Back to CWE list