CVE-2022-31023
JSON

5.9medium

Dev error stack trace leaking into prod in Play Framework

Severity
5.9medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.36% (higher than 72% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-p9p4-97g9-wcrh

Description

Play Framework is a web framework for Java and Scala. Verions prior to 2.8.16 are vulnerable to generation of error messages containing sensitive information. 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. 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. A workaround is available. 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 the application is not using the `DefaultHttpErrorHandler` static object in any code that may be run in production.

Affected

Product or packageVersionsReported by
playframework playframework< 2.8.16CVE List
com.typesafe.play:play_2.12 (Maven)before 2.8.16GitHub Advisory Database
com.typesafe.play:play_2.13 (Maven)before 2.8.16GitHub Advisory Database
lightbend play_frameworkbefore 2.8.16NVD

All scores

GitHub_M5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:P/I:N/A:N

Classification

CWE-209

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Play Framework is a web framework for Java and Scala. Verions prior to 2.8.16 are vulnerable to generation of error messages containing sensitive information. 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. 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. A workaround is available. 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 the application is not using the `DefaultHttpErrorHandler` static object in any code that may be run in production.

GitHub Advisory Database
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:

NVD (es)

Play Framework es un framework web para Java y Scala. Las versiones anteriores a 2.8.16 son vulnerables a una generación de mensajes de error que contienen información confidencial. Play Framework, cuando es ejecutado en modo dev, muestra errores verbose para facilitar la depuración, incluyendo un seguimiento de la pila de excepciones. Play hace esto configurando su "DefaultHttpErrorHandler" para que lo haga en función del modo de aplicación. En su API Scala, Play también proporciona un objeto estático "DefaultHttpErrorHandler" que está configurado para mostrar siempre los errores verbose. Esto es usado como valor por defecto en algunas APIs de Play, por lo que es posible usar inadvertidamente esta versión en producción. También es posible configurar incorrectamente la instancia del objeto "DefaultHttpErrorHandler" como administrador de errores inyectado. Ambas situaciones podrían resultar en que sean mostrados errores verbales a usuarios en una aplicación de producción, lo que podría exponer información confidencial de la aplicación. En concreto, el constructor de "CORSFilter" y el método "apply" de "CORSActionBuilder" usan el objeto estático "DefaultHttpErrorHandler" como valor por defecto. Esto ha sido corregido en Play Framework versión 2.8.16. El objeto "DefaultHttpErrorHandler" ha sido cambiado para usar el comportamiento del modo prod, y ha sido introducido "DevHttpErrorHandler" para el comportamiento del modo dev. Se presenta una mitigación disponible. Cuando construya un "CORSFilter" o un "CORSActionBuilder", asegúrese de que es pasado un manejador de errores correctamente configurado. Generalmente, esto debería hacerse al usar la instancia "HttpErrorHandler" proporcionada mediante la inyección de dependencia o mediante "BuiltInComponents" de Play. Asegúrese de que la aplicación no usa el objeto estático "DefaultHttpErrorHandler" en ningún código que pueda ejecutarse en producción

References

Sources

SourceRecordLicence
CVE ListCVE-2022-31023 changed 2025-04-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-p9p4-97g9-wcrh changed 2025-11-03CC-BY-4.0
NVDCVE-2022-31023 changed 2026-06-17Public domain