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

CVE-2022-36064

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

Descrizione

Shescape is a shell escape package for JavaScript. An Inefficient Regular Expression Complexity vulnerability impacts users that use Shescape to escape arguments for the Unix shells `Bash` and `Dash`, or any not-officially-supported Unix shell; and/or using the `escape` or `escapeAll` functions with the `interpolation` option set to `true`. An attacker can cause polynomial backtracking or quadratic runtime in terms of the input string length due to two Regular Expressions in Shescape that are vulnerable to Regular Expression Denial of Service (ReDoS). This bug has been patched in v1.5.10. For `Dash` only, this bug has been patched since v1.5.9. As a workaround, a maximum length can be enforced on input strings to Shescape to reduce the impact of the vulnerability. It is not recommended to try and detect vulnerable input strings, as the logic for this may end up being vulnerable to ReDoS itself.

Prodotti coinvolti

FornitoreProdottoVersionePiattaforma
shescape project shescape >= 1.5.1 < 1.5.10 node.js
Tutte le 10 vulnerabilità di Shescape Project Shescape

Tipo di vulnerabilità

CWE-1333 Espressione regolare inefficiente (ReDoS)

Il prodotto usa un’espressione regolare che nel caso peggiore ha una complessità di calcolo molto alta, anche esponenziale: un input costruito ad arte può bloccare il servizio.

Impatto sui sistemi

AmbitoImpatto
Disponibilità Interruzione del servizio: esaurimento della CPU

Come si previene

Architettura e progettazione Use regular expressions that do not support backtracking, e.g. by removing nested quantifiers.
Configurazione del sistema Set backtracking limits in the configuration of the regular expression implementation, such as PHP's pcre.backtrack_limit. Also consider limits on execution time for the process.
Sviluppo Do not use regular expressions with untrusted input. If regular expressions must be used, avoid using backtracking in the expression.
Sviluppo Limit the length of the input that the regular expression will process.

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

Tutte le 533 CVE di tipo CWE-1333, con andamento e prevenzione

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