Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
CVE-2022-44311 — Lettura fuori dai limiti in html2xhtml : CVE-2022-44311 | Kitploit
Strumenti/GitHubGitHub/desmondsanctity/cve-2022-44311
Memory ForensicsAnalisi delle VulnerabilitàExploitFuzzingAnalisi di BinariApprendimento e Formazione
GitHubdesmondsanctity/cve-2022-44311

CVE-2022-44311

Lettura fuori dai limiti in html2xhtml : CVE-2022-44311

Vedi Repository
23 anni faNon ancora revisionato

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi

Lettura fuori dai limiti in html2xhtml : CVE-2022-44311

Sommario

Html2xhtml v1.3 è stato scoperto contenere una lettura fuori dai limiti nella funzione static void elm_close(tree_node_t *nodo) in procesador.c. Questa vulnerabilità consente agli attaccanti di accedere a file sensibili o causare una Denial of Service (DoS) tramite un file html appositamente predisposto.

CWE-125 Out-of-Bounds Read è un tipo di errore software che può verificarsi quando si leggono dati dalla memoria. Ciò può accadere se il programma tenta di leggere oltre la fine di un array, ad esempio. Le letture fuori dai limiti possono portare a crash o altre vulnerabilità impreviste e possono consentire a un attaccante di leggere informazioni sensibili a cui non dovrebbe avere accesso.

Prodotto

html2xhtml

Versione testata

1.3

Dettagli

Problema: lettura fuori dai limiti in html2xhtml/src/procesador.c. (GHSA-28fm-qh2h-3mch)

Html2xhtml è uno strumento a riga di comando che converte file HTML in file XHTML. Html2xhtml può generare output XHTML conforme a uno dei seguenti tipi di documento: XHTML 1.0 (Transitional, Strict e Frameset), XHTML 1.1, XHTML Basic e XHTML Mobile Profile.

La vulnerabilità è stata scoperta a causa di un errore di segmentazione (segfault) che si verificava quando si utilizzava l'opzione -t frameset. Un errore di segmentazione o segfault è un tipo specifico di errore causato dall'accesso a memoria che non ti appartiene. È un meccanismo di supporto che impedisce di corrompere la memoria e introdurre bug di memoria difficili da debuggare.

Con l'uso di Valgrind, uno strumento per trovare errori di accesso alla memoria heap (memoria allocata dinamicamente con new o malloc) in programmi C e C++, l'errore di segmentazione è stato debuggato e ha riportato una lettura non valida di 4 byte nel caso di test:

root@kitploit:~
==1040381== Memcheck, a memory error detector
==1040381== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1040381== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==1040381== Command: ./src/html2xhtml -t frameset report/vuln/id:000000,sig:11,src:001386+001369,time:12081510,execs:2336913,op:splice,rep:16
==1040381== 
==1040381== Invalid read of size 4
==1040381==    at 0x40E911: elm_close (procesador.c:944)
==1040381==    by 0x410617: err_html_struct (procesador.c:1889)
==1040381==    by 0x40F20A: err_content_invalid (procesador.c:0)
==1040381==    by 0x40F20A: elm_close (procesador.c:959)
==1040381==    by 0x40E7C4: saxEndDocument (procesador.c:233)
==1040381==    by 0x40DF7A: main (html2xhtml.c:117)
==1040381==  Address 0x6f20d4 is not stack'd, malloc'd or (recently) free'd
==1040381== 
==1040381== 
==1040381== Process terminating with default action of signal 11 (SIGSEGV)
==1040381==  Access not within mapped region at address 0x6F20D4
==1040381==    at 0x40E911: elm_close (procesador.c:944)
==1040381==    by 0x410617: err_html_struct (procesador.c:1889)
==1040381==    by 0x40F20A: err_content_invalid (procesador.c:0)
==1040381==    by 0x40F20A: elm_close (procesador.c:959)
==1040381==    by 0x40E7C4: saxEndDocument (procesador.c:233)
==1040381==    by 0x40DF7A: main (html2xhtml.c:117)
==1040381==  If you believe this happened as a result of a stack
==1040381==  overflow in your program's main thread (unlikely but
==1040381==  possible), you can try to increase the size of the
==1040381==  main thread stack using the --main-stacksize= flag.
==1040381==  The main thread stack size used in this run was 8388608.
==1040381== 
==1040381== HEAP SUMMARY:
==1040381==     in use at exit: 88,190 bytes in 13 blocks
==1040381==   total heap usage: 22 allocs, 9 frees, 2,218,413 bytes allocated
==1040381== 
==1040381== LEAK SUMMARY:
==1040381==    definitely lost: 0 bytes in 0 blocks
==1040381==    indirectly lost: 0 bytes in 0 blocks
==1040381==      possibly lost: 0 bytes in 0 blocks
==1040381==    still reachable: 88,190 bytes in 13 blocks
==1040381==         suppressed: 0 bytes in 0 blocks
==1040381== Rerun with --leak-check=full to see details of leaked memory
==1040381== 
==1040381== For lists of detected and suppressed errors, rerun with: -s
==1040381== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==1040419== Memcheck, a memory error detector

Il log degli errori di Valgrind ci ha portato alla seguente funzione in cui si è verificato il segfault:

https://github.com/jfisteus/html2xhtml/blob/ffb2f1f12910eb5945413e0bdb9272b508241aa1/src/procesador.c#L940

image

È stato riscontrato che manca un controllo di tipo nella funzione. L'utente passava un nodo di tipo comment invece di element alla funzione e questo comporta un errore di lettura fuori dai limiti. Un utente potrebbe fornire un documento malformato con un ELM_PTR(nodo).contenttype[doctype] non valido, risultando nel seguente confronto in assembly:

root@kitploit:~
cmp    dword ptr [rbp + rax*4 + 0xc], 4

Questa vulnerabilità può essere sfruttata dagli attaccanti per leggere file sensibili, memoria o locazioni utilizzando un file alterato.

Impatto

  • Questa issue può essere sfruttata dagli attaccanti per leggere memoria, locazioni o file sensibili.
  • Gli attaccanti possono anche causare un attacco Denial of Service (DoS) tramite un file html appositamente predisposto.

Patch

  • Questa vulnerabilità riguarda qualsiasi utente che utilizzi qualsiasi versione impacchettata del software. Esiste una correzione collegata a questo commit nel ramo master del repository GitHub del software.
  • Si consiglia agli utenti di scaricare gli aggiornamenti recenti del pacchetto datati 25 ottobre 2022 o successivi e di compilare sulla propria macchina. Non ci sono nuove release o versioni dopo la correzione del bug.

Risorse

  • https://nvd.nist.gov/vuln/detail/CVE-2022-44311
  • jfisteus/html2xhtml#19
  • https://securityboulevard.com/2022/06/what-is-an-out-of-bounds-read-and-out-of-bounds-write-error/
  • https://cwe.mitre.org/data/definitions/125.html

Metriche di base CVSS

CVE

  • CVE-2022-44311

Crediti

  • Questo problema è stato scoperto e segnalato da @Halcy0nic come issue al repository del software html2xhtml.
Scarica lo strumento
GravitàAlta 8.1 / 10
Complessità dell'attaccoBassa
Privilegi richiestiNessuno
Interazione dell'utenteRichiesta
AmbitoInvariato
RiservatezzaAlta
IntegritàNessuna
DisponibilitàAlta