CWE-594 Variant Incomplete

J2EE Framework: Saving Unserializable Objects to Disk

This vulnerability occurs when a J2EE application framework attempts to save objects to disk that cannot be properly serialized, risking application failure.

Definition

What is CWE-594?

This vulnerability occurs when a J2EE application framework attempts to save objects to disk that cannot be properly serialized, risking application failure.
To handle high traffic, J2EE frameworks often move objects from memory to disk. This includes session and application data. However, these frameworks don't always verify that the objects are serializable first. When the system tries to write an unserializable object, the serialization process fails, which can crash the application or cause unpredictable behavior. An attacker can exploit this weakness to cause a denial of service. By flooding the server with requests, they can trigger the framework's disk-writing mechanism. If enough unserializable objects are forced to disk, the repeated serialization failures can overwhelm the application, making it unavailable to legitimate users.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-594

Bisher sind in MITREs Katalog keine öffentlichen CVE-Referenzen mit dieser CWE verknüpft.

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    Identifiziere einen Codepfad, der nicht vertrauenswürdige Eingaben ohne Validierung verarbeitet.

  2. 2

    Erzeuge eine Payload, die das unsichere Verhalten auslöst — Injection, Traversal, Overflow oder Logik-Missbrauch.

  3. 3

    Liefere die Payload über einen normalen Request aus und beobachte die Reaktion der Anwendung.

  4. 4

    Iteriere, bis die Antwort Daten preisgibt, Angreifer-Code ausführt oder Berechtigungen eskaliert.

Verwundbares Codebeispiel

Vulnerable Java

In the following Java example, a Customer Entity JavaBean provides access to customer information in a database for a business application. The Customer Entity JavaBean is used as a session scoped object to return customer information to a Session EJB.

Verwundbar Java
@Entity
  public class Customer {
  		private String id;
  		private String firstName;
  		private String lastName;
  		private Address address;
  		public Customer() {
  		}
  		public Customer(String id, String firstName, String lastName) {...}
  		@Id
  		public String getCustomerId() {...}
  		public void setCustomerId(String id) {...}
  		public String getFirstName() {...}
  		public void setFirstName(String firstName) {...}
  		public String getLastName() {...}
  		public void setLastName(String lastName) {...}
  		@OneToOne()
  		public Address getAddress() {...}
  		public void setAddress(Address address) {...}
  }
Sicheres Codebeispiel

Secure Java

However, the Customer Entity JavaBean is an unserialized object which can cause serialization failure and crash the application when the J2EE container attempts to write the object to the system. Session scoped objects must implement the Serializable interface to ensure that the objects serialize properly.

Sicher Java
public class Customer implements Serializable {...}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Präventions-Checkliste

How to prevent CWE-594

  • Architecture and Design / Implementation All objects that become part of session and application scope must implement the java.io.Serializable interface to ensure serializability of containing objects.
Erkennungssignale

How to detect CWE-594

SAST High

Führe statische Analyse (SAST) auf der Codebasis aus und suche im Datenfluss nach dem unsicheren Muster.

DAST Moderate

Führe dynamische Application-Security-Tests gegen den Live-Endpoint aus.

Runtime Moderate

Beobachte Runtime-Logs auf ungewöhnliche Exception-Traces, fehlerhafte Eingaben oder Versuche, Autorisierung zu umgehen.

Code review Moderate

Code Review: Markiere jeden neuen Code, der Eingaben von dieser Oberfläche ohne validierte Framework-Helper verarbeitet.

Plexicus Auto-Fix

Plexicus erkennt CWE-594 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.

Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.

Häufig gestellte Fragen

Frequently asked questions

Was ist CWE-594?

This vulnerability occurs when a J2EE application framework attempts to save objects to disk that cannot be properly serialized, risking application failure.

Wie gravierend ist CWE-594?

MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.

Welche Sprachen oder Plattformen sind von CWE-594 betroffen?

MITRE lists the following affected platforms: Java.

Wie kann ich CWE-594 verhindern?

All objects that become part of session and application scope must implement the java.io.Serializable interface to ensure serializability of containing objects.

Wie erkennt und behebt Plexicus CWE-594?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-594 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.

Wo erfahre ich mehr über CWE-594?

MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/594.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.

Verwandte Schwachstellen

Weaknesses related to CWE-594

CWE-1076 Parent

Insufficient Adherence to Expected Conventions

This weakness occurs when software code, design, documentation, or other components fail to follow established industry or…

CWE-1045 Sibling

Parent Class with a Virtual Destructor and a Child Class without a Virtual Destructor

This occurs when a base class defines a virtual destructor, but a derived class inherits from it without declaring its own virtual…

CWE-1070 Sibling

Serializable Data Element Containing non-Serializable Item Elements

This weakness occurs when a class or data structure is marked as serializable, but it contains one or more member elements that cannot be…

CWE-1078 Sibling

Inappropriate Source Code Style or Formatting

This weakness occurs when source code violates established style guidelines for formatting, indentation, whitespace, or commenting, making…

CWE-1079 Sibling

Parent Class without Virtual Destructor Method

This occurs when a base class, designed to be inherited from, does not declare its destructor as virtual. This oversight prevents proper…

CWE-1082 Sibling

Class Instance Self Destruction Control Element

This vulnerability occurs when an object's code contains logic that triggers its own deletion or destruction during runtime.

CWE-1087 Sibling

Class with Virtual Method without a Virtual Destructor

This occurs when a class defines a virtual method but does not also provide a virtual destructor.

CWE-1091 Sibling

Use of Object without Invoking Destructor Method

This weakness occurs when a program accesses an object but fails to properly call its destructor or finalizer method. This leaves the…

CWE-1097 Sibling

Persistent Storable Data Element without Associated Comparison Control Element

This weakness occurs when a persistent data object lacks the necessary methods to be properly compared, which can lead to inconsistent or…

Bereit, wenn du es bist

Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.

Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.