Skip to content

Dev error stack trace leaking into prod in Play Framework

Moderate severity GitHub Reviewed Published Jun 2, 2022 in playframework/playframework • Updated Jan 27, 2023

Package

maven com.typesafe.play:play_2.12 (Maven)

Affected versions

< 2.8.16

Patched versions

2.8.16
maven com.typesafe.play:play_2.13 (Maven)
< 2.8.16
2.8.16

Description

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:

References

@gmethvin gmethvin published to playframework/playframework Jun 2, 2022
Published by the National Vulnerability Database Jun 2, 2022
Published to the GitHub Advisory Database Jun 3, 2022
Reviewed Jun 3, 2022
Last updated Jan 27, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N

EPSS score

0.234%
(62nd percentile)

Weaknesses

CVE ID

CVE-2022-31023

GHSA ID

GHSA-p9p4-97g9-wcrh

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.