TL;DR
JANUS is an automated "red-blue" adversarial framework that synthesizes multi-layer defenses against web deserialization attacks. By coordinating controls across the gateway, application, and system layers, it reduces exploit success rates to just 6.2%—outperforming state-of-the-art baselines by 3x—while ensuring that 98.4% of legitimate application functionality remains intact.
What Problem Does This Paper Address?
Unsafe deserialization is a "top-tier" web vulnerability where an application reconstructs objects from untrusted data, inadvertently allowing attackers to trigger malicious code execution (RCE). Defending against it is notoriously difficult for three reasons:
- Diversity of Exploits: A single vulnerability can be exploited using dozens of different "gadget chains" (sequences of existing library methods) or various data encodings that bypass simple signature-based filters.
- Defensive Blind Spots: Existing defenses usually live in silos. A Web Application Firewall (WAF) at the gateway might miss a re-encoded payload; an application-level filter might miss a new gadget chain; and system-level sandboxing might be too restrictive, breaking the app's legitimate features.
- Coordination Complexity: Manually configuring a "defense-in-depth" strategy that uses all three layers without causing redundant overhead or breaking the business logic requires significant expert effort.
Methods
The authors propose JANUS, a framework that automates the "security engineer's loop" through an adversarial process:
- The Red-Blue Loop: JANUS pairs an automated Attacker (Red) with a Defender (Blue) in an isolated environment. The attacker tries to find bypasses for the current defense, and the defender uses those failures to refine the policy.
- Black-Box Attack Exploration: The attacker agent is "black-box," meaning it only sees external feedback like HTTP response codes and timing. It draws from a catalog of known gadget families to find variants that the current defense misses.
- Evidence-Guided Refinement: When an attack succeeds, the defender analyzes system logs and application traces to create an "attack-effect summary." It then selects the best combination of controls (e.g., WAF rules, class allowlists, syscall filters) to block that specific effect.
- Counterfactual Coverage Attribution: This is a key innovation. JANUS replays successful attacks while "masking" (disabling) certain rules. This allows it to see if a downstream rule would have caught the attack if the upstream one failed, helping to eliminate redundant rules and identify single points of failure.
- Regression-Guarded Evolution: Every candidate policy is automatically tested against a suite of "benign workflows." If a security rule breaks a legitimate feature (like a file upload or a database query), the defender must find a narrower, more precise way to block the attack.
Datasets
The researchers evaluated JANUS on 16 vulnerability deployments across six popular Java and PHP applications, including:
- Apache OFBiz (ERP system)
- Jenkins (CI/CD server)
- Liferay Portal (Enterprise portal)
- Metabase (Business intelligence)
- Apache ActiveMQ (Message broker)
- Snipe-IT (Asset management)
They used a total of 64 held-out test attacks (variants the system didn't see during training) and a suite of benign workflows to measure functional impact.
Key Insights and Ideas
- The "Decisive Constraint" Principle: The authors found that while gateway rules (WAF) are great "cheap" pre-filters, the most robust defenses often happen at the application layer after decoding, where the true "type" of the data is visible.
- Redundancy is a Feature, Not a Bug: In security, having multiple layers catch the same attack is good. JANUS's counterfactual replay ensures that every attack is covered by at least two layers whenever possible, creating true defense-in-depth.
- Context is King: A system-level rule that blocks all file writes might stop an attack but break the app. JANUS learns to scope these rules—for example, allowing writes to a specific temporary directory needed for legitimate work while blocking writes to sensitive configuration files.
Key Results
JANUS was compared against several industry-standard baselines, including ModSecurity (WAF), Datadog RASP, and Tetragon (eBPF-based system enforcement).
- Security: JANUS reduced the held-out Attack Success Rate (ASR) to 6.2%. For comparison, the best-performing baseline (Tetragon) had an ASR of 18.8%, and the WAF baseline was at 55.0%.
- Reliability: It fully mitigated the vulnerability in 13 out of 16 deployments.
- Functionality: It preserved 98.4% of benign functionality, whereas the highly secure Tetragon baseline broke nearly 20% of legitimate workflows.
- Performance: The synthesized defenses added a manageable 6.9% increase in P95 latency.
Limitations and Future Work
- Empirical vs. Proven: JANUS provides empirical protection based on the variants it discovers; it does not "prove" an application is unhackable.
- Dependency on Workflows: The quality of the defense is limited by the quality of the provided benign workflows. If a legitimate feature isn't included in the regression suite, JANUS might accidentally break it.
- Root Cause: The authors emphasize that JANUS is a mitigation tool, not a fix. It buys time for developers to patch the underlying code bug without leaving the application exposed.
- Future Directions: The team suggests applying this cross-layer synthesis approach to other classes of vulnerabilities, such as Server-Side Request Forgery (SSRF) and Template Injection.
Summary updated