CWE-594 Variante Incompleto

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.

Definición

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.
Impacto en el mundo real

Real-world CVEs caused by CWE-594

Todavía no hay CVEs públicos enlazados a esta CWE en el catálogo de MITRE.

Cómo lo explotan los atacantes

Ruta del atacante paso a paso

  1. 1

    Identifica una ruta de código que maneje entrada no confiable sin validación.

  2. 2

    Crea un payload que ejercite el comportamiento inseguro — inyección, traversal, overflow o abuso de lógica.

  3. 3

    Envía el payload a través de una solicitud normal y observa la reacción de la aplicación.

  4. 4

    Itera hasta que la respuesta filtre datos, ejecute código del atacante o escale privilegios.

Ejemplo de código vulnerable

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.

Vulnerable 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) {...}
  }
Ejemplo de código seguro

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.

Seguro 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.
Lista de prevención

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.
Señales de detección

How to detect CWE-594

SAST High

Ejecuta análisis estático (SAST) sobre el código buscando el patrón inseguro en el flujo de datos.

DAST Moderate

Ejecuta pruebas dinámicas de seguridad de aplicaciones (DAST) contra el endpoint en vivo.

Runtime Moderate

Vigila los logs en tiempo de ejecución para detectar trazas de excepción inusuales, entradas malformadas o intentos de bypass de autorización.

Code review Moderate

Revisión de código: marca cualquier código nuevo que maneje entrada desde esta superficie sin usar los helpers validados del framework.

Auto-corrección de Plexicus

Plexicus detecta automáticamente CWE-594 y abre un PR de corrección en menos de 60 segundos.

Codex Remedium escanea cada commit, identifica esta debilidad concreta y entrega un pull request listo para revisión con el parche. Sin tickets. Sin traspasos.

Preguntas frecuentes

Frequently asked questions

¿Qué es CWE-594?

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

¿Qué gravedad tiene CWE-594?

MITRE no ha publicado una calificación de probabilidad de explotación para esta debilidad. Trátala como de impacto medio hasta que tu modelo de amenazas demuestre lo contrario.

¿Qué lenguajes o plataformas se ven afectados por CWE-594?

MITRE lists the following affected platforms: Java.

¿Cómo puedo prevenir CWE-594?

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

¿Cómo detecta y corrige Plexicus CWE-594?

El motor SAST de Plexicus detecta la firma de flujo de datos para CWE-594 en cada commit. Cuando hay coincidencia, nuestro agente Codex Remedium abre un PR de corrección con el código corregido, las pruebas y un resumen de una línea para el revisor.

¿Dónde puedo aprender más sobre CWE-594?

MITRE publica la definición canónica en https://cwe.mitre.org/data/definitions/594.html. También puedes consultar la documentación de OWASP y NIST para guías relacionadas.

Debilidades relacionadas

Weaknesses related to CWE-594

CWE-1076 Padre

Insufficient Adherence to Expected Conventions

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

CWE-1045 Hermano

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 Hermano

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 Hermano

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 Hermano

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 Hermano

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 Hermano

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 Hermano

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 Hermano

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…

Listo cuando tú lo estés

Deja de pagar por desarrollador.
Empieza a cerrar el bucle.

Plexicus es el ASPM nativo de IA que escanea, filtra, corrige, pentestea y explica — de forma autónoma. Desarrolladores ilimitados, repos ilimitados, acciones de IA de uso justo. Nivel gratuito real, €269/mo anual cuando estés listo.