# What is CVE-2022-31023?

> CVE-2022-31023 is a high-severity flaw (CVSS 7.5) in Play Framework from Lightbend, published on 2 June 2022. It is not on the list of flaws known to be exploited today. The latest forecast puts its chance of use in the next 30 days at 1.3%. If you run an affected version, plan in the vendor’s fix.

Canonical page: https://www.precursorintelligence.com/what-is/cve-2022-31023

## At a glance

- **Verdict:** Plan it in. No sign of exploitation and a low forecast. Patch it in your normal update cycle.
- **Precursor Intelligence risk score:** 46 out of 100 (Medium); action: Plan remediation. Kept up to date as the evidence changes.
- **Severity:** High (CVSS 7.5 out of 10)
- **Known to be exploited:** No, not on the list of flaws known to be exploited today
- **Chance of use in the next 30 days:** 1.3% (latest exploit-likelihood forecast)
- **Published:** 2 June 2022
- **Record last updated:** 11 June 2022
- **Main product:** Play Framework from Lightbend
- **Affected products:** 1

## What is CVE-2022-31023? In plain terms

It can be attacked from anywhere on the internet without logging in, and nobody has to click anything. If it works, the attacker can read data.

### The official 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.

### What kind of flaw is it?

- CWE-209: Generation of Error Message Containing Sensitive Information

### How an attack on it works

- Where an attacker can be: Anywhere on the internet
- How hard it is to pull off: Easy: no special conditions
- Login needed first: No login needed
- Does someone have to click: No, nobody has to do anything
- What an attacker gets: Can read data

Severity vector: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`

## Is CVE-2022-31023 being exploited? Not that we know of

It is not on the list of flaws known to be exploited today. The latest forecast puts the chance of it being used in the next 30 days at 1.3%. That can change at any time, which is why we keep watching.

Exploit likelihood over the last 7 days: 1.3%, 1.3%, 1.3%, 1.3%, 1.3%, 1.3%, 1.3%.

### Timeline

- 2 June 2022: Published
- 11 June 2022: Record last updated

### How Precursor Intelligence ranks it

CVE-2022-31023 scores **46 out of 100 (Medium)**, with the action "Plan remediation".

Every published flaw gets a risk score from 0 to 100, kept up to date as the evidence changes. Four things go into the score, from the one that counts most to the ones that count less:

- Evidence it is being exploited: biggest factor
- How severe it is: strong factor
- How widely exposed it is: smaller factor
- Threat activity around it: smaller factor

85 and above is Critical. Anything confirmed as exploited is always marked for an emergency patch, whatever its score. When this flaw matches software you track, it lands in your list with its score and the reasons behind it.

## Who is affected by CVE-2022-31023?

The published record lists 1 product. Versions are as published: "before 2.8.16" means every version up to, but not including, 2.8.16.

- [Play Framework](https://www.precursorintelligence.com/product/lightbend/play_framework) by [Lightbend](https://www.precursorintelligence.com/vendors/lightbend) (Application): before 2.8.16

## How do I fix CVE-2022-31023?

1. **Check whether you run it.** Compare your versions with the affected products above. Not sure what you run? Precursor Intelligence can work it out from your public website, or you can pick it from a list.
2. **Apply the vendor’s fix.** Install the update named in the vendor’s advisory. We’ve put the advisories and patch notes first in the list.
3. **If you can’t patch today.** Follow any mitigation the vendor publishes, and limit who can reach the affected system from the internet until the update is in.
4. **Keep an eye on it.** Track the product and we tell you as soon as we spot this flaw on the list of exploited flaws, or a jump in its exploit likelihood.

### References

- [github.com](https://github.com/playframework/playframework/pull/11305) (Issue tracking, Patch, Third-party advisory)
- [github.com](https://github.com/playframework/playframework/security/advisories/GHSA-p9p4-97g9-wcrh) (Mitigation, Third-party advisory)
- [github.com](https://github.com/playframework/playframework/releases/tag/2.8.16) (Release notes, Third-party advisory)

## Questions

### What is CVE-2022-31023?

CVE-2022-31023 is a high-severity flaw in Play Framework from Lightbend, published on 2 June 2022. It can be attacked from anywhere on the internet without logging in, and nobody has to click anything. If it works, the attacker can read data.

### How serious is CVE-2022-31023?

It scores 7.5 out of 10 on the CVSS severity scale, which is high. Our risk score for CVE-2022-31023 is 46 out of 100, which is Medium. Its action is "Plan remediation". No sign of exploitation and a low forecast. Patch it in your normal update cycle.

### Is CVE-2022-31023 being exploited?

It is not on the list of flaws known to be exploited today. The latest forecast puts the chance of it being used in the next 30 days at 1.3%. That can change at any time, which is why we keep watching.

### Which versions does CVE-2022-31023 affect?

For Play Framework from Lightbend: before 2.8.16.

### How do I fix CVE-2022-31023?

Install the update the vendor names in its advisory, linked first under "How do I fix" on this page. If you can't patch today, follow the vendor's mitigation and limit who can reach the affected system from the internet.

## Does CVE-2022-31023 affect you?

Precursor Intelligence keeps checking for you:

- **Tell us what you run.** Pick your software from a list, or let us work it out from your website.
- **We match it to every flaw.** Over 400,000 published flaws, checked against your list.
- **Ranked by real-world risk.** Every flaw gets a 0 to 100 risk score, kept up to date, led by evidence criminals are using it.
- **Told as soon as we know.** An alert by email, in the app or by webhook to your own tools.

Start free (no card, nothing to install): https://www.precursorintelligence.com/register
Book a demo: https://www.precursorintelligence.com/contact

