Crashes during parsing of malformed OSMX files
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Riproduci i crash con i file OSMX malformati collegati, quindi parti da osmx::db::Metadata::get nello stack trace e ispeziona il codice correlato in mdb.c. Traccia il modo in cui l'input malformato raggiunge la ricerca nel database e verifica che i file forniti non causino più il crash del processo; aggiungi una copertura di regressione se i test esistenti del progetto offrono un punto adatto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi there,
During fuzz testing of the OSMX parsing there were a couple crashes discovered. Although these files only crash the apps, they could potentially be crafted further into security issues where a malformed OSMX file would be able compromise the process's memory through memory corruption, so hardening the code to prevent these kinds of bugs would be great.
You can download the crashing files in a zip from Ufile to debug and understand where the code is crashing.
Here's a snip of one of the crash logs.
Program received signal SIGSEGV, Segmentation fault.
mdb_xcursor_init1 (mc=0x7fffffffdd00, node=0x7efff767ffda) at mdb.c:7507
7507 mx->mx_db.md_pad = 0;
#0 mdb_xcursor_init1 (mc=0x7fffffffdd00, node=0x7efff767ffda) at mdb.c:7507
#1 mdb_cursor_set (mc=0x7fffffffdd00, key=0x7fffffffe0b0,
data=0x7fffffffe0a0, op=MDB_SET, exactp=0x7fffffffdcfc) at mdb.c:6142
#2 0x00000000005aceb5 in mdb_get (txn=<optimized out>, dbi=<optimized out>,
key=0x7fffffffe0b0, data=0x7fffffffe0a0) at mdb.c:5762
#3 0x000000000040fb30 in osmx::db::Metadata::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#4 0x000000000040da0b in main ()
rax 0x0 0
rbx 0x7fffffffdd00 140737488346368
rcx 0x7efff767ffff 139637832548351
rdx 0x1d 29
rsi 0x1000000000000 281474976710656
rdi 0x7efff767ffda 139637832548314
rbp 0x7fffffffdcfc 0x7fffffffdcfc
rsp 0x7fffffffdc90 0x7fffffffdc90
r8 0x7fffffffdcfc 140737488346364
r9 0x6c9a73 7117427
r10 0x6c9828 7116840
r11 0x7ffff7872be0 140737346218976
r12 0x7fffffffe0b0 140737488347312
r13 0x7efff767f000 139637832544256
r14 0xf 15
r15 0x7fffffffe0a0 140737488347296
rip 0x5ad1ba 0x5ad1ba <mdb_cursor_set+762>
eflags 0x10206 [ PF IF RF ]
cs 0x33 51
ss 0x2b 43
ds 0x0 0
es 0x0 0
fs 0x0 0
gs 0x0 0
=> 0x5ad1ba <mdb_cursor_set+762>: mov %rsi,0x188(%rax)
0x5ad1c1 <mdb_cursor_set+769>:
movaps 0x9aa78(%rip),%xmm0 # 0x647c40
0x5ad1c8 <mdb_cursor_set+776>: movups %xmm0,0x190(%rax)
0x5ad1cf <mdb_cursor_set+783>: movq $0x0,0x1a0(%rax)
'exploitable' version 1.32
Linux ubuntu 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64
Signal si_signo: 11 Signal si_addr: 392
Nearby code:
0x00000000005ad19e <+734>: jne 0x5ad284 <mdb_cursor_set+964>
0x00000000005ad1a4 <+740>: movzx edx,WORD PTR [rdi+0x6]
0x00000000005ad1a8 <+744>: lea rcx,[rdi+rdx*1]
0x00000000005ad1ac <+748>: add rcx,0x8
0x00000000005ad1b0 <+752>: movabs rsi,0x1000000000000
=> 0x00000000005ad1ba <+762>: mov QWORD PTR [rax+0x188],rsi
0x00000000005ad1c1 <+769>: movaps xmm0,XMMWORD PTR [rip+0x9aa78] # 0x647c40
0x00000000005ad1c8 <+776>: movups XMMWORD PTR [rax+0x190],xmm0
0x00000000005ad1cf <+783>: mov QWORD PTR [rax+0x1a0],0x0
0x00000000005ad1da <+794>: movzx esi,WORD PTR [rdi+rdx*1+0x14]
Stack trace:
# 0 mdb_xcursor_init1 at 0x5ad1ba in OSMExpress/osmx
# 1 mdb_cursor_set at 0x5ad1ba in OSMExpress/osmx
# 2 mdb_get at 0x5aceb5 in OSMExpress/osmx
# 3 osmx::db::Metadata::get(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at 0x40fb30 in OSMExpress/osmx
# 4 main at 0x40da0b in OSMExpress/osmx
Faulting frame: # 0 mdb_xcursor_init1 at 0x5ad1ba in OSMExpress/osmx
Description: Access violation near NULL on destination operand
Short description: DestAvNearNull (15/22)
Hash: 474dceedaab021c3f42b9dc0bd4ed041.474dceedaab021c3f42b9dc0bd4ed041
Exploitability Classification: PROBABLY_EXPLOITABLE
Explanation: The target crashed on an access violation at an address matching the destination operand of the instruction. This likely indicates a write access violation, which means the attacker may control write address and/or value. However, it there is a chance it could be a NULL dereference.
Other tags: AccessViolation (21/22)
Thanks!
- Lingua principale
- C++
- Stelle
- 274
- Fork
- 23
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bdon/OSMExpress
-
Release binaries?Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
bdon/OSMExpress#79 · 3 commenti ·
-
Optimize build timeAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
bdon/OSMExpress#63 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
bdon/OSMExpress#51 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
bdon/OSMExpress#48 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
bdon/OSMExpress#39 · 1 commento ·
Tutte le issue di bdon/OSMExpress
Issue simili
-
bug intrinsic medium priority rt_lib
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
OpenPrinting/splix#33 · 3 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
sumatrapdfreader/sumatrapdf#6417 · 3 commenti ·
-
[BUG] Cython cache evicts most recent instead of oldest entry on cleanupForse già presa @scoder l’ha presa oggi. ApertaBuild System defect
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100