1. Archivio CVE
  2. 2022
  3. CVE-2022-31023

CVE-2022-31023

7.5 Gravità alta CVSS v3.1 · fonte NVD CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N 7.5 – Alta

Descrizione

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.

Prodotti coinvolti

FornitoreProdottoVersionePiattaforma
lightbend play framework < 2.8.16 –
Tutte le 11 vulnerabilità di Lightbend Play Framework

Tipo di vulnerabilità

CWE-209 Messaggi di errore che rivelano informazioni sensibili

Il prodotto genera messaggi di errore che contengono informazioni sensibili sul proprio ambiente, sugli utenti o sui dati.

Impatto sui sistemi

AmbitoImpatto
Riservatezza Leggere i dati dell’applicazione

Come si previene

Sviluppo Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success. If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files. Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
Sviluppo Handle exceptions internally and do not display errors containing potentially sensitive information to a user.
Sviluppo · Riduzione della superficie di attacco Use naming conventions and strong types to make it easier to spot when sensitive data is being used. When creating structures, objects, or other complex entities, separate the sensitive and non-sensitive data as much as possible.
Sviluppo · Build e compilazione · Hardening della compilazione Debugging information should not make its way into a production release.
Sviluppo · Build e compilazione · Hardening dell’ambiente Debugging information should not make its way into a production release.
Configurazione del sistema Where available, configure the environment to use less verbose error messages. For example, in PHP, disable the display_errors setting during configuration, or at runtime using the error_reporting() function.
Configurazione del sistema Create default error pages or messages that do not leak any information.

Le indicazioni di mitigazione sono riportate nella lingua originale del catalogo CWE del MITRE.

Tutte le 648 CVE di tipo CWE-209, con andamento e prevenzione

Fonte: catalogo CWE del MITRE · cwe.mitre.org