Vulnerabilities in pkg:maven/com.typesafe.play/play_2.12

PACKAGE
Advisory Identifier: GHSA-p9p4-97g9-wcrh
Advisory Summary

CVE-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.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/com.typesafe.play/play_2.12

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/com.typesafe.play/play_2.12. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-p9p4-97g9-wcrh CVE-2022-31023 MODERATE Dev error stack trace leaking into prod in Play Framework
GHSA-v4mq-p756-p4f5 CVE-2018-13864 HIGH Play Framework's Assets controller vulnerable to directory traversal
GHSA-v8x6-59g4-5g3w CVE-2022-31018 HIGH Denial of service binding form from JSON in Play Framework
GHSA-cf8j-64h9-6q58 CVE-2020-12480 MODERATE CSRF in Play Framework

CVE-2022-31023 at a Glance

CVE Identifier CVE-2022-31023
GHSA Identifier GHSA-p9p4-97g9-wcrh
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-209: Generation of Error Message Containing Sensitive Information
Affected Product Play 2.12
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

com.typesafe.play:play_2.12 fixed: 2.8.16
<dependency>
    <groupId>com.typesafe.play</groupId>
    <artifactId>play_2.12</artifactId>
    <version>2.8.16</version>
</dependency>
com.typesafe.play:play_2.13 fixed: 2.8.16
<dependency>
    <groupId>com.typesafe.play</groupId>
    <artifactId>play_2.13</artifactId>
    <version>2.8.16</version>
</dependency>
Verify Direct and Transitive Dependencies

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

### Impact Play 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. In particular the constructor for `CORSFilter` and `apply` method for `CORSActionBuilder` use the static object `DefaultHttpErrorHandler` as a default value. ### Patches This 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. ### Workarounds When 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. ### References https://www.playframework.com/documentation/2.8.x/ScalaErrorHandling#Supplying-a-custom-error-handler https://www.playframework.com/documentation/2.8.x/JavaErrorHandling#Supplying-a-custom-error-handler ### For more information If you have any questions or comments about this advisory: * Open an issue in [playframework/playframework](https://github.com/playframework/playframework/) * Email us at [security@playframework.com](mailto:security@playframework.com)

CVE-2022-31023 Affected Play 2.12 Versions

2 component(s)
Fixed Versions:
2.8.16
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?
CVE-2022-31023 is a security vulnerability in Play 2.12 involving Dev error stack trace leaking into prod in Play Framework under CWE-209: Generation of Error Message Containing Sensitive Information.
Which Play 2.12 versions are affected?
Affected versions include releases prior to 2.8.16 across affected packages: com.typesafe.play:play_2.12, com.typesafe.play:play_2.13.
What version fixes CVE-2022-31023?
Upgrading to 2.8.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is play_2.12 affected?
Yes, com.typesafe.play:play_2.12 is affected in releases prior to 2.8.16. Upgrade your dependency to 2.8.16 or later.
Is play_2.13 affected?
Yes, com.typesafe.play:play_2.13 is affected in releases prior to 2.8.16. Upgrade your dependency to 2.8.16 or later.
What is the CVSS score of CVE-2022-31023?
CVE-2022-31023 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-31023?
CVE-2022-31023 is classified under CWE-209: Generation of Error Message Containing Sensitive Information (The product generates an error message that includes sensitive information about its environment, users, or associated data.).
How can I check Maven dependencies for CVE-2022-31023?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.typesafe.play'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}