Weakness · Medium
CWE-594: J2EE Framework: Saving Unserializable Objects to Disk
What it is
When the J2EE container attempts to write unserializable objects to disk there is no guarantee that the process will complete successfully.
- Severity (our rating)
- Medium
- Likelihood of exploit
- Not rated by MITRE
- Introduced during
- Implementation
- Exploited in the wild
- No CVE in CISA's catalog
In more detail
In heavy load conditions, most J2EE application frameworks flush objects to disk to manage memory requirements of incoming requests. For example, session scoped objects, and even application scoped objects, are written to disk when required. While these application frameworks do the real work of writing objects to disk, they do not enforce that those objects be serializable, thus leaving the web application vulnerable to crashes induced by serialization failure. An attacker may be able to mount a denial of service attack by sending enough requests to the server to force the web application to save objects to disk.
What an attacker can do
- Modify Application Data (Integrity)
- DoS: Crash, Exit, or Restart (Availability)
How to prevent it
Architecture and Design
- All objects that become part of session and application scope must implement the java.io.Serializable interface to ensure serializability of containing objects.
H2 Security
Found it in your code?
We review where it appears, fix it with your team, and check it was not already used against you.
Talk to our teamT Academy
Stop writing it in the first place
Learn to build software and systems without weaknesses like this one, with practice on real hosts in your browser, every objective checked on the machine.
Start freeSource: MITRE Common Weakness Enumeration, CWE version 4.19.1. CWE is a trademark of The MITRE Corporation.