CVE-2022-31023: Play 2.12 Dev Error Stack Trace Leaking Vulnerability
MODERATECVE-2022-31023 is a MODERATE (CVSS 5.9) dev error stack trace leaking vulnerability (CWE-209: Generation of Error Message Containing Sensitive Information) affecting Play 2.12 libraries in the Maven ecosystem. The issue involves dev error stack trace leaking into prod in play framework. Remediation is available by upgrading affected packages to version 2.8.16.
CVE-2022-31023 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2022-31023
To remediate this vulnerability, upgrade all affected Play 2.12 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.12</artifactId>
<version>2.8.16</version>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play_2.13</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-31023, 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.12 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-209: Generation of Error Message Containing Sensitive Information, where the product generates an error message that includes sensitive information about its environment, users, or associated data. In Play 2.12, 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-31023 Affected Play 2.12 Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
com.typesafe.play:play_2.12
|
Maven |
< 2.8.16
|
2.8.16
|
|
com.typesafe.play:play_2.13
|
Maven |
< 2.8.16
|
2.8.16
|
References
Frequently Asked Questions
What is CVE-2022-31023?
Which Play 2.12 versions are affected?
What version fixes CVE-2022-31023?
Is play_2.12 affected?
Is play_2.13 affected?
What is the CVSS score of CVE-2022-31023?
What CWE is associated with CVE-2022-31023?
How can I check Maven dependencies for CVE-2022-31023?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-p9p4-97g9-wcrh",
"modified" : "2025-11-03T21:05:45Z",
"published" : "2022-06-03T22:19:23Z",
"aliases" : [ "CVE-2022-31023" ],
"summary" : "Dev error stack trace leaking into prod in Play Framework",
"details" : "### Impact\n\nPlay Framework, when run in dev mode, shows verbose errors for easy debugging, including an exception stack trace. Play does this by configuring its `DefaultHttpErrorHandler` to do so based on the application mode. In its Scala API Play also provides a static object `DefaultHttpErrorHandler` that is configured to always show verbose errors. This is used as a default value in some Play APIs, so it is possible to inadvertently use this version in production. It is also possible to improperly configure the `DefaultHttpErrorHandler` object instance as the injected error handler. Both of these situations could result in verbose errors displaying to users in a production application, which could expose sensitive information from the application.\n\nIn particular the constructor for `CORSFilter` and `apply` method for `CORSActionBuilder` use the static object `DefaultHttpErrorHandler` as a default value.\n\n### Patches\n\nThis is patched in Play Framework 2.8.16. The `DefaultHttpErrorHandler` object has been changed to use the prod-mode behavior, and `DevHttpErrorHandler` has been introduced for the dev-mode behavior.\n\n### Workarounds\n\nWhen constructing a `CORSFilter` or `CORSActionBuilder`, ensure that a properly-configured error handler is passed. Generally this should be done by using the `HttpErrorHandler` instance provided through dependency injection or through Play's `BuiltInComponents`. Ensure that your application is not using the `DefaultHttpErrorHandler` static object in any code that may be run in production.\n\n### References\nhttps://www.playframework.com/documentation/2.8.x/ScalaErrorHandling#Supplying-a-custom-error-handler\nhttps://www.playframework.com/documentation/2.8.x/JavaErrorHandling#Supplying-a-custom-error-handler\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [playframework/playframework](https://github.com/playframework/playframework/)\n* Email us at [security@playframework.com](mailto:security@playframework.com)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "com.typesafe.play:play_2.12"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.16"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.typesafe.play:play_2.13"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.16"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/playframework/playframework/security/advisories/GHSA-p9p4-97g9-wcrh"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31023"
}, {
"type" : "WEB",
"url" : "https://github.com/playframework/playframework/pull/11305"
}, {
"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-209" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-03T22:19:23Z",
"nvd_published_at" : "2022-06-02T18:15:00Z"
}
}