1. Archivio CVE
  2. 2021
  3. CVE-2021-44737

CVE-2021-44737

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

Descrizione

PJL directory traversal vulnerability in Lexmark devices through 2021-12-07 that can be leveraged to overwrite internal configuration files.

Prodotti coinvolti

FornitoreProdottoVersionePiattaforma
lexmark 6500e firmware < lhs60.jr.p753 –
lexmark b2236 firmware < mslsg.076.294 –
lexmark b2338 firmware < msngm.076.294 –
lexmark b2442 firmware < msngm.076.294 –
lexmark b2546 firmware < msngm.076.294 –
lexmark b2650 firmware < msngm.076.294 –
lexmark b2865 firmware < msngw.076.294 –
lexmark b3340 firmware < mslbd.076.294 –
lexmark b3442 firmware < mslbd.076.294 –
lexmark c2132 firmware < lw80.vy4.p210 –
lexmark c2240 firmware < cstzj.076.294 –
lexmark c2325 firmware < csnzj.076.294 –
lexmark c2326 firmware < cslbn.076.294 –
lexmark c2425 firmware < csnzj.076.294 –
lexmark c2535 firmware < csnzj.076.294 –
lexmark c3224 firmware < cslbl.076.294 –
lexmark c3326 firmware < cslbl.076.294 –
lexmark c3426 firmware < cslbn.076.294 –
lexmark c4150 firmware < cstat.076.294 –
lexmark c6160 firmware < cstpp.076.294 –
lexmark c734 firmware < lr.sk.p835 –
lexmark c736 firmware < lr.ske.p835 –
lexmark c746 firmware < lhs60.cm2.p753 –
lexmark c748 firmware < lhs60.cm4.p753 –
lexmark c792 firmware < lhs60.hc.p753 –
lexmark c9235 firmware < cstmh.076.294 –
lexmark c925 firmware < lhs60.hv.p753 –
lexmark c950 firmware < lhs60.tp.p753 –
lexmark cs310 firmware < lw80.vyl.p210 –
lexmark cs317 firmware < lw80.vyl.p210 –
lexmark cs331 firmware < cslbl.076.294 –
lexmark cs410 firmware < lw80.vy2.p210 –
lexmark cs417 firmware < lw80.vy2.p210 –
lexmark cs421 firmware < csnzj.076.294 –
lexmark cs431 firmware < cslbn.076.294 –
lexmark cs439 firmware < cslbn.076.294 –
lexmark cs510 firmware < lw80.vy4.p210 –
lexmark cs517 firmware < lw80.vy4.p210 –
lexmark cs521 firmware < csnzj.076.294 –
lexmark cs622 firmware < cstzj.076.294 –
lexmark cs720 firmware < cstat.076.294 –
lexmark cs725 firmware < cstat.076.294 –
lexmark cs727 firmware < cstat.076.294 –
lexmark cs728 firmware < cstat.076.294 –
lexmark cs748 firmware < lhs60.cm4.p753 –
lexmark cs796 firmware < lhs60.hc.p753 –
lexmark cs820 firmware < cstpp.076.294 –
lexmark cs827 firmware < cxtpp.076.294 –
lexmark cs827 firmware < cstpp.076.294 –
lexmark cs921 firmware < cstmh.076.294 –
lexmark cs923 firmware < cstmh.076.294 –
lexmark cs927 firmware < cstmh.076.294 –
lexmark cx310 firmware < lw80.gm2.p210 –
lexmark cx317 firmware < lw80.gm2.p210 –
lexmark cx331 firmware < cxlbl.076.294 –
lexmark cx410 firmware < lw80.gm4.p210 –
lexmark cx417 firmware < lw80.gm4.p210 –
lexmark cx421 firmware < cxnzj.076.294 –
lexmark cx431 firmware < cxlbn.076.294 –
lexmark cx510 firmware < lw80.gm7.p210 –
lexmark cx517 firmware < lw80.gm7.p210 –
lexmark cx522 firmware < cxtzj.076.294 –
lexmark cx622 firmware < cxtzj.076.294 –
lexmark cx625 firmware < cxtzj.076.294 –
lexmark cx725 firmware < cxtat.076.294 –
lexmark cx727 firmware < cxtat.076.294 –
lexmark cx820 firmware < cxtpp.076.294 –
lexmark cx825 firmware < cxtpp.076.294 –
lexmark cx860 firmware < cxtpp.076.294 –
lexmark cx920 firmware < cxtmh.076.294 –
lexmark cx921 firmware < cxtmh.076.294 –
lexmark cx922 firmware < cxtmh.076.294 –
lexmark cx923 firmware < cxtmh.076.294 –
lexmark cx924 firmware < cxtmh.076.294 –
lexmark e46x firmware < lr.lbh.p835 –
lexmark m1140 firmware < lw80.prl.p210 –
lexmark m1140+ firmware < lw80.pr2.p210 –
lexmark m1145 firmware < lw80.pr2.p210 –
lexmark m1242 firmware < msngm.076.294 –
lexmark m1246 firmware < msngm.076.294 –
lexmark m1342 firmware < mslbd.076.294 –
lexmark m3150de firmware < lw80.pr4.p210 –
lexmark m3150dn firmware < lw80.pr2.p210 –
lexmark m3250 firmware < mstgm.076.294 –
lexmark m5155 firmware < lw80.dn4.p210 –
lexmark m5163de firmware < lw80.dn4.p210 –
lexmark m5163dn firmware < lw80.dn2.p210 –
lexmark m5170 firmware < lw80.dn7.p210 –
lexmark m5255 firmware < mstgw.076.294 –
lexmark m5270 firmware < mstgw.076.294 –
lexmark mb2236 firmware < mxlsg.076.294 –
lexmark mb2338 firmware < mxngm.076.294 –
lexmark mb2442 firmware < mxtgm.076.294 –
lexmark mb2546 firmware < mxtgm.076.294 –
lexmark mb2650 firmware < mxtgm.076.294 –
lexmark mb2770 firmware < mxtgw.076.294 –
lexmark mb3442 firmware < mxlbd.076.294 –
lexmark mc2325 firmware < cxnzj.076.294 –
lexmark mc2425 firmware < cxnzj.076.294 –
lexmark mc2535 firmware < cxtzj.076.294 –

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

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