CVE-2022-31018: Play 2.13 Denial of Service Vulnerability
HIGHCVE-2022-31018 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Play 2.13 libraries in the Maven ecosystem. The issue involves denial of service binding form from json in play framework. Remediation is available by upgrading affected packages to version 2.8.16.
CVE-2022-31018 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-31018
To remediate this vulnerability, upgrade all affected Play 2.13 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play_2.13</artifactId>
<version>2.8.16</version>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play_2.12</artifactId>
<version>2.8.16</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=com.typesafe.play
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-31018, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=com.typesafe.play
Analyze the terminal output to locate any version of Play 2.13 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.16), your application is affected.
Note: The mvn dependency:tree -Dincludes=com.typesafe.play command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Play 2.13, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-31018 Affected Play 2.13 Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
com.typesafe.play:play_2.13
|
Maven |
≥ 2.8.3
< 2.8.16
|
2.8.16
|
|
com.typesafe.play:play_2.12
|
Maven |
≥ 2.8.3
< 2.8.16
|
2.8.16
|
References
Frequently Asked Questions
What is CVE-2022-31018?
Which Play 2.13 versions are affected?
What version fixes CVE-2022-31018?
Is play_2.13 affected?
Is play_2.12 affected?
What is the CVSS score of CVE-2022-31018?
What CWE is associated with CVE-2022-31018?
How can I check Maven dependencies for CVE-2022-31018?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v8x6-59g4-5g3w",
"modified" : "2022-06-14T20:00:10Z",
"published" : "2022-06-03T22:18:58Z",
"aliases" : [ "CVE-2022-31018" ],
"summary" : "Denial of service binding form from JSON in Play Framework",
"details" : "### Impact\n\nA denial-of-service vulnerability has been discovered in Play's forms library, in both the Scala and Java APIs. This can occur when using either the `Form#bindFromRequest` method on a JSON request body or the `Form#bind` method directly on a JSON value. If the JSON data being bound to the form contains a deeply-nested JSON object or array, the form binding implementation may consume all available heap space and cause an `OutOfMemoryError`. If executing on the default dispatcher and `akka.jvm-exit-on-fatal-error` is enabled—as it is by default—then this can crash the application process.\n\n`Form.bindFromRequest` is vulnerable when using any body parser that produces a type of `AnyContent` or `JsValue` in Scala, or one that can produce a `JsonNode` in Java. This includes Play's default body parser.\n\n### Patches\n\nThis vulnerability been patched in version 2.8.16. There is now a global limit on the depth of a JSON object that can be parsed, which can be configured by the user if necessary.\n\n### Workarounds\n\nApplications that do not need to parse a request body of type `application/json` can switch from the default body parser to another body parser that supports only the specific type of body they expect; for example, the `formUrlEncoded` body parser can be used if the Play action only needs to accept `application/x-www-form-urlencoded`.\n\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "com.typesafe.play:play_2.13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.8.3"
}, {
"fixed" : "2.8.16"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.typesafe.play:play_2.12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.8.3"
}, {
"fixed" : "2.8.16"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/playframework/playframework/security/advisories/GHSA-v8x6-59g4-5g3w"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31018"
}, {
"type" : "WEB",
"url" : "https://github.com/playframework/playframework/pull/11301"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/playframework/playframework"
}, {
"type" : "WEB",
"url" : "https://github.com/playframework/playframework/releases/tag/2.8.16"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-03T22:18:58Z",
"nvd_published_at" : "2022-06-02T17:15:00Z"
}
}