Skip to content
OpenAdvisories

Weakness (CWE)

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

Variant Draft

A J2EE application uses System.exit().

How to prevent it (4 mitigations)
  1. Architecture and Design

    The shutdown function should be a privileged function available only to a properly authorized administrative user.

  2. Implementation

    Web applications should not call methods that cause the virtual machine to exit, such as System.exit().

  3. Implementation

    Web applications should not throw any Throwables to the application server, as this may adversely affect the container.

  4. Implementation

    Non-web applications may have a main() method that contains a System.exit(), but generally should not call System.exit() from other locations in the code.

Source: MITRE CWE-382

1 result · Feed