{"id":"CVE-2022-31023","aliases":["GHSA-p9p4-97g9-wcrh"],"url":"https://o3.security/vulnerability/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)","published":"2022-06-02T18:05:11Z","modified":"2026-10-28T02:31:03.157885885Z","cvss":{"score":5.9,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Maven","name":"com.typesafe.play:play_2.12","fixedVersion":"2.8.16"},{"ecosystem":"Maven","name":"com.typesafe.play:play_2.13","fixedVersion":"2.8.16"}],"fix":{"url":"https://github.com/playframework/playframework/pull/11305","label":"playframework/playframework#11305"},"references":[{"type":"WEB","url":"https://github.com/playframework/playframework/releases/tag/2.8.16"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31023.json"},{"type":"ADVISORY","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":"FIX","url":"https://github.com/playframework/playframework/pull/11305"},{"type":"PACKAGE","url":"https://github.com/playframework/playframework"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:31:03.157885885Z"}}