1. Archivio CVE
  2. 2020
  3. CVE-2020-1631

CVE-2020-1631

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

Descrizione

A vulnerability in the HTTP/HTTPS service used by J-Web, Web Authentication, Dynamic-VPN (DVPN), Firewall Authentication Pass-Through with Web-Redirect, and Zero Touch Provisioning (ZTP) allows an unauthenticated attacker to perform local file inclusion (LFI) or path traversal. Using this vulnerability, an attacker may be able to inject commands into the httpd.log, read files with 'world' readable permission file or obtain J-Web session tokens. In the case of command injection, as the HTTP service runs as user 'nobody', the impact of this command injection is limited. (CVSS score 5.3, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N) In the case of reading files with 'world' readable permission, in Junos OS 19.3R1 and above, the unauthenticated attacker would be able to read the configuration file. (CVSS score 5.9, vector CVSS:3.1/ AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N) If J-Web is enabled, the attacker could gain the same level of access of anyone actively logged into J-Web. If an administrator is logged in, the attacker could gain administrator access to J-Web. (CVSS score 8.8, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) This issue only affects Juniper Networks Junos OS devices with HTTP/HTTPS services enabled. Junos OS devices with HTTP/HTTPS services disabled are not affected. If HTTP/HTTPS services are enabled, the following command will show the httpd processes: user@device> show system processes | match http 5260 - S 0:00.13 /usr/sbin/httpd-gk -N 5797 - I 0:00.10 /usr/sbin/httpd --config /jail/var/etc/httpd.conf To summarize: If HTTP/HTTPS services are disabled, there is no impact from this vulnerability. If HTTP/HTTPS services are enabled and J-Web is not in use, this vulnerability has a CVSS score of 5.9 (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N). If J-Web is enabled, this vulnerability has a CVSS score of 8.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H). Juniper SIRT has received a single report of this vulnerability being exploited in the wild. Out of an abundance of caution, we are notifying customers so they can take appropriate actions. Indicators of Compromise: The /var/log/httpd.log may have indicators that commands have injected or files being accessed. The device administrator can look for these indicators by searching for the string patterns "=*;*&" or "*%3b*&" in /var/log/httpd.log, using the following command: user@device> show log httpd.log | match "=*;*&|=*%3b*&" If this command returns any output, it might be an indication of malicious attempts or simply scanning activities. Rotated logs should also be reviewed, using the following command: user@device> show log httpd.log.0.gz | match "=*;*&|=*%3b*&" user@device> show log httpd.log.1.gz | match "=*;*&|=*%3b*&" Note that a skilled attacker would likely remove these entries from the local log file, thus effectively eliminating any reliable signature that the device had been attacked. This issue affects Juniper Networks Junos OS 12.3 versions prior to 12.3R12-S16; 12.3X48 versions prior to 12.3X48-D101, 12.3X48-D105; 14.1X53 versions prior to 14.1X53-D54; 15.1 versions prior to 15.1R7-S7; 15.1X49 versions prior to 15.1X49-D211, 15.1X49-D220; 16.1 versions prior to 16.1R7-S8; 17.2 versions prior to 17.2R3-S4; 17.3 versions prior to 17.3R3-S8; 17.4 versions prior to 17.4R2-S11, 17.4R3-S2; 18.1 versions prior to 18.1R3-S10; 18.2 versions prior to 18.2R2-S7, 18.2R3-S4; 18.3 versions prior to 18.3R2-S4, 18.3R3-S2; 18.4 versions prior to 18.4R1-S7, 18.4R3-S2 ; 18.4 version 18.4R2 and later versions; 19.1 versions prior to 19.1R1-S5, 19.1R3-S1; 19.1 version 19.1R2 and later versions; 19.2 versions prior to 19.2R2; 19.3 versions prior to 19.3R2-S3, 19.3R3; 19.4 versions prior to 19.4R1-S2, 19.4R2; 20.1 versions prior to 20.1R1-S1, 20.1R2.

Prodotti coinvolti

FornitoreProdottoVersionePiattaforma
juniper junos 14.1x53 d47 –
juniper junos 14.1x53 d48 –
juniper junos 14.1x53 d49 –
juniper junos 14.1x53 d50 –
juniper junos 14.1x53 d51 –
juniper junos 14.1x53 d52 –
juniper junos 14.1x53 d53 –
juniper junos 15.1 –
juniper junos 15.1 a1 –
juniper junos 15.1 f –
juniper junos 15.1 f1 –
juniper junos 15.1 f2 –
juniper junos 15.1 f2-s1 –
juniper junos 15.1 f2-s2 –
juniper junos 15.1 f2-s3 –
juniper junos 15.1 f2-s4 –
juniper junos 15.1 f3 –
juniper junos 15.1 f4 –
juniper junos 15.1 f5 –
juniper junos 15.1 f5-s7 –
juniper junos 15.1 f6 –
juniper junos 15.1 f6-s1 –
juniper junos 15.1 f6-s12 –
juniper junos 15.1 f6-s2 –
juniper junos 15.1 f6-s3 –
juniper junos 15.1 f6-s4 –
juniper junos 15.1 f6-s7 –
juniper junos 15.1 f7 –
juniper junos 15.1 r1 –
juniper junos 15.1 r2 –
juniper junos 15.1 r3 –
juniper junos 15.1 r4 –
juniper junos 15.1 r4-s7 –
juniper junos 15.1 r4-s8 –
juniper junos 15.1 r4-s9 –
juniper junos 15.1 r5 –
juniper junos 15.1 r5-s1 –
juniper junos 15.1 r5-s5 –
juniper junos 15.1 r5-s6 –
juniper junos 15.1 r6 –
juniper junos 15.1 r6-s1 –
juniper junos 15.1 r6-s2 –
juniper junos 15.1 r6-s6 –
juniper junos 15.1 r7 –
juniper junos 15.1 r7-s1 –
juniper junos 15.1 r7-s2 –
juniper junos 15.1 r7-s3 –
juniper junos 15.1 r7-s4 –
juniper junos 15.1 r7-s5 –
juniper junos 15.1x49 –
juniper junos 15.1x49 d10 –
juniper junos 15.1x49 d100 –
juniper junos 15.1x49 d110 –
juniper junos 15.1x49 d120 –
juniper junos 15.1x49 d130 –
juniper junos 15.1x49 d140 –
juniper junos 15.1x49 d15 –
juniper junos 15.1x49 d150 –
juniper junos 15.1x49 d160 –
juniper junos 15.1x49 d170 –
juniper junos 15.1x49 d180 –
juniper junos 15.1x49 d190 –
juniper junos 15.1x49 d20 –
juniper junos 15.1x49 d200 –
juniper junos 15.1x49 d210 –
juniper junos 15.1x49 d25 –
juniper junos 15.1x49 d30 –
juniper junos 15.1x49 d35 –
juniper junos 15.1x49 d40 –
juniper junos 15.1x49 d45 –
juniper junos 15.1x49 d50 –
juniper junos 15.1x49 d55 –
juniper junos 15.1x49 d60 –
juniper junos 15.1x49 d65 –
juniper junos 15.1x49 d70 –
juniper junos 15.1x49 d75 –
juniper junos 15.1x49 d80 –
juniper junos 15.1x49 d90 –
juniper junos 16.1 –
juniper junos 16.1 r1 –
juniper junos 16.1 r2 –
juniper junos 16.1 r3 –
juniper junos 16.1 r3-s10 –
juniper junos 16.1 r3-s11 –
juniper junos 16.1 r4 –
juniper junos 16.1 r4-s12 –
juniper junos 16.1 r4-s2 –
juniper junos 16.1 r4-s3 –
juniper junos 16.1 r4-s4 –
juniper junos 16.1 r4-s6 –
juniper junos 16.1 r5 –
juniper junos 16.1 r5-s4 –
juniper junos 16.1 r6-s1 –
juniper junos 16.1 r6-s6 –
juniper junos 16.1 r7 –
juniper junos 16.1 r7-s2 –
juniper junos 16.1 r7-s3 –
juniper junos 16.1 r7-s4 –
juniper junos 16.1 r7-s5 –
juniper junos 16.1 r7-s6 –

Mostrate 100 configurazioni su 277. L'elenco completo è su NVD.

Tutte le 793 vulnerabilità di Juniper Junos

Tipo di vulnerabilità

CWE-22 Path traversal: percorso non limitato alla cartella consentita

Il prodotto costruisce il percorso di un file o di una cartella con dati provenienti dall’esterno, senza neutralizzare gli elementi speciali (come «../») che permettono di uscire dalla cartella a cui l’accesso dovrebbe essere limitato.

Impatto sui sistemi

AmbitoImpatto
Integrità, Riservatezza, Disponibilità Eseguire codice o comandi non autorizzati
Integrità Modificare file o cartelle
Riservatezza Leggere file o cartelle
Disponibilità Interruzione del servizio: arresto o riavvio

Come si previene

Sviluppo · Validazione dell’input Considera ogni input come potenzialmente malevolo. Adotta una validazione per «elenco di valori ammessi»: accetta solo gli input che rispettano rigorosamente le specifiche e rifiuta, o trasforma in qualcosa di conforme, tutto il resto. Nel validare considera tutte le proprietà rilevanti: lunghezza, tipo, intervallo dei valori ammessi, input mancanti o in più, sintassi, coerenza tra campi collegati e rispetto delle regole di business (per esempio «barca» è sintatticamente valido perché contiene solo lettere, ma non lo è se il campo deve contenere solo colori come rosso o blu). Non limitarti a cercare input malevoli o malformati: quasi certamente ne sfuggirà qualcuno, soprattutto se l’ambiente del codice cambia, lasciando all’attaccante lo spazio per aggirare la validazione. Le liste di valori vietati restano utili per rilevare possibili attacchi o scartare subito gli input più malformati. Per i nomi di file usa elenchi rigorosi dei caratteri ammessi. Se possibile, consenti un solo carattere «.» nel nome, per evitare errori come CWE-23, ed escludi i separatori di cartella come «/», per evitare CWE-36. Usa un elenco delle estensioni ammesse, utile anche contro CWE-434. Non affidarti solo a un filtro che rimuove i caratteri pericolosi: equivale a una lista di valori vietati, che può essere incompleta (CWE-184). Per esempio, filtrare «/» non basta se il file system accetta anche «\» come separatore; e un filtro applicato male può produrre comunque dati pericolosi (CWE-182): se si rimuovono in sequenza le occorrenze di «../» dalla stringa «.../...//», i caratteri rimasti formano di nuovo «../».
Architettura e progettazione Per ogni controllo di sicurezza eseguito lato client, ripeti lo stesso controllo lato server, per evitare CWE-602: un attaccante può aggirare i controlli del client modificando i valori dopo il controllo o eliminando del tutto i controlli dal client, e inviare poi al server i valori modificati.
Sviluppo · Validazione dell’input Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked. Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes .. sequences and symbolic links (CWE-23, CWE-59). This includes: realpath() in C getCanonicalPath() in Java GetFullPath() in ASP.NET realpath() or abs_path() in Perl realpath() in PHP
Architettura e progettazione · Librerie o framework Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
Esercizio · Firewall Usa un firewall applicativo (WAF) in grado di rilevare attacchi contro questo tipo di vulnerabilità. È utile quando il codice non può essere corretto (perché controllato da terzi), come misura d’emergenza in attesa di interventi più completi, o come difesa aggiuntiva.
Architettura e progettazione · Esercizio · Hardening dell’ambiente Run your code using the lowest privileges that are required to accomplish the necessary tasks. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Architettura e progettazione · Conversione in valori ammessi When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs. For example, ID 1 could map to inbox.txt and ID 2 could map to profile.txt. Features such as the ESAPI AccessReferenceMap provide this capability.
Architettura e progettazione · Esercizio · Sandbox o jail Esegui il codice in una «jail» o in una sandbox simile, che imponga confini rigidi tra il processo e il sistema operativo. Così si può limitare a quali file in una cartella si può accedere o quali comandi il software può eseguire (per esempio con chroot su Unix, AppArmor o SELinux). Il codice gestito può offrire una certa protezione: in Java, per esempio, java.io.FilePermission del SecurityManager permette di limitare le operazioni sui file. Non sempre è una soluzione praticabile e limita l’impatto solo sul sistema operativo: il resto dell’applicazione può comunque essere compromesso. Attenzione a CWE-243 e agli altri errori legati alle jail.

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

Tutte le 11.327 CVE di tipo CWE-22, con andamento e prevenzione

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