JANUS: Synthesizing Cross-Layer Defenses Against Web Deserialization Attacks
Organizations: Singapore Management University, Singapore · UESTC, China · Nanyang Technological University, Singapore · The Hong Kong Polytechnic University, China
Abstract
Unsafe deserialization turns untrusted data into attacker-controlled execution, and a single vulnerability can admit diverse exploit variants that evade defenses tailored to a known exploit. Existing defenses typically operate at a single enforcement point with limited visibility into the full attack. Combining controls across layers offers complementary protection, but coordinating them to preserve legitimate functionality and adapting them to new variants requires substantial expert effort. We propose JANUS, a red-blue adversarial framework for automated cross-layer defense synthesis. Starting from a known exploit, \sys iteratively refines deployment-specific policies in an isolated offline environment. A black-box attacker probes the current policy for exploit variants using only externally observable feedback. The defender summarizes each verified variant into its security-relevant effects, uses counterfactual replay to separate complementary coverage from redundant enforcement, and jointly selects and scopes controls across layers. Each candidate policy is validated against accumulated exploits and benign workflows. We evaluate JANUS on sixteen vulnerability deployments across six Java and PHP applications against gateway, application, system, and cross-layer defenses. JANUS reduces held-out attack success to 6.2%, compared with 18.8-55.0% for the baselines, fully mitigates 13 of 16 deployments, and preserves 98.4% of benign functionality tests at a 6.9% targeted P95 latency increase.
Figures & tables
| ID | Control | Configurable Policy | Effect |
| G1 | Ingress Limits | Allowed routes and methods, body-size cap | B |
| G2 | Virtual Patch | Request-match rules and action | B |
| A1 | Class Filtering | Class allowlist, others rejected | B |
| A2 | Graph Limits | Depth, references, bytes, array length | B |
| A3 | Parser Filter | Class blocklist in the parser’s own filter | B |
| S1 | Execution Limits | Deny process-execution system calls | L |
| Held-out security | Changed attack settings | Functionality and latency | Overhead | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | ASR | Mitigated | Breached | Main | Switch | Aware | Human | FPR | BPR | P95 | No regr. | Other P95 | RPS | Offline |
| ModSecurity + CRS | 55.0 | 0/15 | 32/45 | 45.5 | 59.1 2.3 | 38/45 | 13/15 | 4.5 | 88.3 | 3.2 | 8/15 | 2.0 | -1.5 | 15 |
| Datadog RASP | 48.4 | 0/16 | 29/48 | 39.6 | 55.6 1.4 | 34/48 | 12/16 | 0.6 | 96.9 | 9.9 | 8/16 | 5.5 | -4.8 | 18 |
| OpenRASP | 50.0 | 0/16 | 32/48 | 41.7 | 59.7 1.4 | 37/48 | 13/16 | 0.8 | 96.9 | 10.9 | 7/16 | 6.0 | -5.5 | 18 |
| Kintsugi | 20.3 | 6/16 | 17/48 | 14.6 | 31.9 2.8 | 23/48 | 9/16 | 0.5 | 95.3 | 9.3 | 12/16 | 1.8 | -2.5 | 12 |
| Tetragon | 18.8 | 8/16 | 18/48 | 12.5 | 36.8 1.4 | 24/48 | 10/16 | 1.2 | 81.2 | 4.6 | 4/16 | 3.5 | -2.0 | 5 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Application | Format | A | Layers | Gadget families |
|---|---|---|---|---|
| OFBiz | Java-native | ✓ | GAS | CommonsBeanutils, ROME, MozillaRhino |
| Jenkins | XStream | ✓ | GAS | nested PersistenceRoot, OfflineCause, ListView, Agent identity, lazy render |
| Liferay | JSON | ✗ | GS | C3P0/ReferenceSerialized, JdbcRowSetImpl |
| Metabase | Java-native | ✓ | GAS | Java URLDNS, Clojure comparator |
| ActiveMQ | JMX / OpenWire | ✗ | GS / S | Jolokia MBean, ClassPathXmlApplicationContext |
| Snipe-IT | PHP object | ✗ | GS | Laravel, Monolog, Guzzle chains |
| ID | CVE | Application (version) | Format | Consequence | Auth | Points |
| Java | ||||||
| J01 | CVE-2020-9496 | Apache OFBiz 17.12.01 | Java-native | RCE | No | G,A,S |
| J02 | CVE-2021-26295 | Apache OFBiz 17.12.01 | Java-native | RCE | No | G,A,S |
| J03 | CVE-2021-29200 | Apache OFBiz 17.12.01 | Java-native | RCE | No | G,A,S |
| J04 | CVE-2021-30128 | Apache OFBiz 17.12.01 | Java-native | RCE | No | G,A,S |
| J05 | CVE-2026-53435 | Jenkins 2.567 | XStream | RCE | Yes | G,A,S |
| Capability | Raw operations | Interceptable by |
|---|---|---|
| proc_exec | execve , execveat (also via posix_spawn ) | S1 |
| file_write | openat (write/create), rename , unlink , chmod | S2, outside writable volumes only |
| file_read | openat (read-only) | none |
| net_egress | connect , sendto (non-loopback) | S3 |
| other | (collapsed to a count) | none |
| Attacker | Defender | |
|---|---|---|
| Sees | Vulnerability description, reviewed fixtures and prerequisites, own requests and external feedback | Attack-effect summaries, coverage matrix, failed workflow assertions, incumbent rules, catalog |
| Never sees | Oracles, defense logs, coverage results, policy text | Held-out attacks, test workflows |
| Returns | Fixture choice and parameters in a request schema | Typed edits with evidence and expected effect |
| ID | Method | Layer | Coverage | Configuration |
|---|---|---|---|---|
| B1 | ModSecurity + CRS ( OWASP Foundation, 2026 ) | G | 15/16 | Tuned paranoia, exclusions |
| B2 | Datadog RASP ( Datadog, 2025 ) | A | 16/16 | Tuned detection rules, thresholds |
| B3 | OpenRASP ( Baidu Security, 2024 ) | A | 16/16 | Tuned detection rules, thresholds |
| B4 | Kintsugi ( Peng et al., 2026 ) | A + S | 16/16 | Reproduced per target |
| B5 | Tetragon ( Cilium Authors, 2025 ) | S | 16/16 | One fixed service-wide policy |
Autonomous Cyber Defense
Autonomous cyber defense uses AI agents to detect, investigate, and contain attacks while balancing operational safety, latency, and human oversight.
See all 72 papers