CWE-579: J2EE Bad Practices: Non-serializable Object Stored in Session

VariantDraft

The product stores a non-serializable object as an HttpSession attribute, which can hurt reliability.

View on MITRE
Back to CWE Lookup

Extended Description

A J2EE application can make use of multiple JVMs in order to improve application reliability and performance. In order to make the multiple JVMs appear as a single application to the end user, the J2EE container can replicate an HttpSession object across multiple JVMs so that if one JVM becomes unavailable another can step in and take its place without disrupting the flow of the application. This is only possible if all session data is serializable, allowing the session to be duplicated between the JVMs.

Technical Details

Structure
Simple

Applicable To

Languages
Java
Platforms

Frequently Asked Questions

What is CWE-579: J2EE Bad Practices: Non-serializable Object Stored in Session?+

CWE-579: J2EE Bad Practices: Non-serializable Object Stored in Session is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The product stores a non-serializable object as an HttpSession attribute, which can hurt reliability. A J2EE application can make use of multiple JVMs in order to improve application reliability and performance. In order to make the multiple JVMs appear as a single application to the end user, the J2EE container can replicate an HttpSession object across multiple JVMs so that if one JVM becomes unavailable another can step in and take its place without disrupting the flow of the application. This is only possible if all session data is serializable, allowing the session to be duplicated between the JVMs.

What are the security consequences of J2EE Bad Practices: Non-serializable Object Stored in Session?+

If exploited, CWE-579 (J2EE Bad Practices: Non-serializable Object Stored in Session) it can compromise Other, leading to outcomes such as Quality Degradation.

How do you prevent or mitigate J2EE Bad Practices: Non-serializable Object Stored in Session?+

Recommended mitigations for CWE-579 include: In order for session replication to work, the values the product stores as attributes in the session must implement the Serializable interface.

Which programming languages are affected by J2EE Bad Practices: Non-serializable Object Stored in Session?+

CWE-579 commonly affects Java. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-579 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More