Highlights
Deserialization Validation Bypass: 1 prior fix. Scrutinize any change in this area.
CurrencyUnit.java: most-fixed (2 issues). Treat as high-risk during review.
1 high-severity fix in this history; regressions here are high-impact.
Recurring patterns
The bug types that recur here, drawn from past fixes, not open vulnerabilities.
Insecure Deserialization: Direct deserialization of monetary value classes can be exploited to create arbitrary or malicious instances, bypassing constructor invariants and potentially leading to data corruption or logic abuse. The fix blocks readObject entirely, indicating the risk is severe enough to warrant full prevention rather than validation.
Deserialization Validation Bypass: Without validation in readResolve, a crafted serialized CurrencyUnit could carry mismatched numeric code or decimal places, violating the singleton invariant and causing inconsistent currency behavior across the application. The fix adds validation to reject such instances, highlighting the need for integrity checks on deserialization paths.