CVE-2022-31018

7.5 HIGH

📋 TL;DR

A denial-of-service vulnerability in Play Framework's forms library allows attackers to crash applications by sending deeply-nested JSON objects. This affects Play Framework versions 2.8.3 through 2.8.15 when using form binding methods with JSON data, causing OutOfMemoryError and potential process termination.

💻 Affected Systems

Products:
  • Play Framework
Versions: 2.8.3 through 2.8.15
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerable when using Form.bindFromRequest or Form.bind methods with JSON data. Default body parser is vulnerable. Both Scala and Java APIs affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Application crashes completely, causing service disruption until manually restarted, with potential data loss for in-memory sessions.

🟠

Likely Case

Application becomes unresponsive or crashes, requiring restart and causing temporary service outage.

🟢

If Mitigated

Application remains stable with proper JSON depth limits or alternative body parsers in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending specially crafted JSON payloads to vulnerable endpoints. No authentication needed if endpoints are publicly accessible.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.8.16

Vendor Advisory: https://github.com/playframework/playframework/security/advisories/GHSA-v8x6-59g4-5g3w

Restart Required: Yes

Instructions:

1. Update Play Framework dependency to version 2.8.16 or later. 2. Update build configuration (build.sbt for Scala, pom.xml for Java). 3. Rebuild and redeploy application. 4. Restart application server.

🔧 Temporary Workarounds

Use alternative body parser

all

Switch from default body parser to one that doesn't parse JSON if application doesn't need JSON support

// In Scala: Use other body parsers like parse.tolerantText
// In Java: Use BodyParser.anyContent other than JSON

Configure JSON depth limit manually

all

Manually implement JSON parsing with depth limits before form binding

// Implement custom JSON parser with depth checking before Form.bindFromRequest

🧯 If You Can't Patch

  • Implement WAF rules to block requests with deeply-nested JSON structures
  • Use rate limiting and request size limits to mitigate impact

🔍 How to Verify

Check if Vulnerable:

Check Play Framework version in build configuration. If using 2.8.3-2.8.15 and using Form.bindFromRequest with JSON, application is vulnerable.

Check Version:

sbt 'show playVersion' for Scala, or check pom.xml for Java projects

Verify Fix Applied:

Verify Play Framework version is 2.8.16 or later in dependencies. Test with nested JSON payloads to confirm application doesn't crash.

📡 Detection & Monitoring

Log Indicators:

  • OutOfMemoryError in application logs
  • Application crash/restart events
  • Unusually large JSON payloads in request logs

Network Indicators:

  • Requests with deeply-nested JSON structures
  • Sudden drop in application availability

SIEM Query:

source="application.logs" AND ("OutOfMemoryError" OR "java.lang.OutOfMemoryError") AND "play.api.data.Form"

🔗 References

📤 Share & Export