{"id":"CVE-2026-62958","summary":"libriscv: Out of bounds read vuln in the ELF parser (Denial of service)","details":"libriscv is a RISC-V sandbox and emulator. Prior to 1.18, a crafted ELF binary can cause out-of-bounds reads in the host emulator. `Memory\u003cW\u003e::binary_loader` checks `PT_LOAD` program-header bounds, but `Memory\u003cW\u003e::serialize_execute_segment` trusts section-header `sh_offset` and `sh_size` when locating `.text` without verifying the file range against `m_binary.size()`; `Memory\u003cW\u003e::lookup()` has a similar section-table problem. Malformed `.text` or `.symtab` offsets can therefore bypass the program-header checks and point outside the binary buffer, crashing rvlinux. With suitable memory layout or integer overflow, out-of-buffer host heap memory may instead be mapped into the guest by `create_execute_segment()`, potentially exposing host memory. The reported reproducer demonstrates a host SIGSEGV, while memory disclosure through grooming is described as possible rather than demonstrated. This issue is fixed in version 1.18.","aliases":["GHSA-gm4g-6c78-gr3w"],"modified":"2026-11-04T07:07:37.365952719Z","published":"2026-10-30T20:44:21.663Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/62xxx/CVE-2026-62958.json","cna_assigner":"GitHub_M","cwe_ids":["CWE-125","CWE-20"]},"references":[{"type":"WEB","url":"https://github.com/libriscv/libriscv/releases/tag/v1.18"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/62xxx/CVE-2026-62958.json"},{"type":"ADVISORY","url":"https://github.com/libriscv/libriscv/security/advisories/GHSA-gm4g-6c78-gr3w"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62958"},{"type":"FIX","url":"https://github.com/libriscv/libriscv/commit/61ef9ca82c8876dd80b33780893ba512af780e93"},{"type":"FIX","url":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/libriscv/libriscv","events":[{"introduced":"0"},{"fixed":"2a501bab10dca3b99370300049bd39d1098e8cd0"},{"fixed":"61ef9ca82c8876dd80b33780893ba512af780e93"},{"fixed":"7bd1c189f9f9d54368cde096b07b194ad680f9fa"}],"database_specific":{"extracted_events":[{"range":[{"introduced":"0"},{"fixed":"1.18"}],"source":"AFFECTED_FIELD","strategy":"StringRangeExpression"},{"range":[{"fixed":"61ef9ca82c8876dd80b33780893ba512af780e93"}],"source":"REFERENCES_COMMIT"},{"range":[{"fixed":"7bd1c189f9f9d54368cde096b07b194ad680f9fa"}],"source":"REFERENCES_COMMIT"},{"source":"REFERENCES_TAG","original_tag":"v1.18","range":[{"fixed":"2a501bab10dca3b99370300049bd39d1098e8cd0"}]}]}}],"versions":["v1.17","v1.16","v1.15","v1.14","v1.13","v1.12","v1.11","v1.10","v1.9","v1.8","v1.7","v1.6","v1.5","v1.4","v1.3","v1.2","v1.1","v1.0","v0.24","v0.23","v0.22","v0.21","v0.20","v0.19","v0.18","v0.17","v0.16","v0.15","v0.14","v0.13","v0.12","v0.11","v0.10","v0.9","v0.8"],"database_specific":{"vanir_signatures":[{"signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"file":"lib/libriscv/memory_elf.cpp"},"deprecated":false,"digest":{"line_hashes":["129724522684237497857504402662983900023","28521539461111243348590484463023968386","150068531949301449202919351772477768289","57012366844657463961501414190059004559","193986608237676306025492804198592605608","206407769480546331668701236683141459165","268211419357406411764396712651770952883","180020646358691997613392460664874462656","63673061931934121749032204134211303733","289657662826047705768854215102539731509","238576180106141936172418114212995248874","159211476367026584858883869938596863577","90705582861628557394313796239126370153","62683413055385181521962203678312205290","4580450159594162026784877975288022237","129590647803408794921637138690546157958","109924298685047869359152712561116522836","300101345038090313343191783152355843759","146910124922102869356349400586344991068","54845024055148836897665690506668273173","313007245244341184648493532144590734070","24800787706844810044692805074335434347","151948348423353395458162748499336888308","152519661266082027292102851976756561607","281180649404253564155624495975753884810","108879861424920615454425357224345101521","158496063202239029399148463718746461765","253615523556201297286972195656090308429","330681642190158609993290886329704605822","115035574723035245633434634631590591471","184611327749466722707652842844897988774","9317580822819648134379035974295655771","120816290348540379015657565058452027216","261519610961458589857459510815449207308","184327255350984475820286792614579525722","100791793584829021291084380892413433466","57614382014469539345628181878527313434","253320549733186545255581206123767210943","200724142566601124414698710017507647989","237625069453642922429447075515516653620","190359345315816269741588815332832028028","45132690749656830185357067919159561318","176433505545339452735969827784309026111","86191157306391560615781496521968316068","185359781999933054541983716986740688816","175170693929386781770319876646738810780","236979259513014690256646421741624149421","184611327749466722707652842844897988774","9317580822819648134379035974295655771","120816290348540379015657565058452027216","261519610961458589857459510815449207308","184327255350984475820286792614579525722","100791793584829021291084380892413433466","57614382014469539345628181878527313434","253320549733186545255581206123767210943","200724142566601124414698710017507647989","176583794007403805176053815694132585365","39984595258255822076577149067727469138","328108311155809798902938831779644072388","129735642601803677052732809347904306384","310614511694539535631490108942909447298","250007256463082567833223139281110932437","130778844423458922847230175056757571172","86191157306391560615781496521968316068","38586281920567616365880998024278902017","63676482218724909512212832749867026613","153156127178066908540399227519013239595","139951486690836873010472504296253833549","17710183197315359219671348231103144153","22474979489652795797086862031063119946","211738873237984726532228075896936353942","2011921605620010524387665163642873738","184039910531198843844461823157432011792","153776400817140359236829309673880653375","54067409429540414662820849240641374365","14387766028155537773995257747932379544","38901707458730972166273141873997502480","222361564634378021315853642946909934401","56181967382000196183918145055846058517","288155969654333263841941828448648417024","272780091698360112250139986149951388308","34326253416841623787418552165176259687","100706342994143699629354676047468064373","194048052263689440641947529449824700007","272953504938116506451240088921169247627","60694856925721199977707545023961162566","239283858280522259704694472531680981540","193841310300354934335379046838678442044","298680703749589389508040441058204358338","212257414583365804359579129665888209398","167316218911273353374147941949420652240","282698004195819158495377301011812878237","153003045038013818463393185256048837363","286524239243190559610217945502529690057","266632981671607103611705070043929363563","163440800561785687467835961664530854935","184226020440000323652930397152019894933","320251859579440163868166117978294922043","264839483885594543904465225261387814919","76720698085743473298800721894121117456","86809401922611905610932684940544464725","188213535038423946579288566062823471557","150549514029760023693985094122164315017","66358502594999965722262127066838185392","325912972404221595741873297094923047020","146641354823596096305194189067689673148","226038594979443970774938877227591997185","194221690541249470694194216851241058524","287698719315539930284316353133970618606","269232620804637754227135109702375811328","45327224856443228781625329703157527104","207224342731795500753265441424350008658","117992394520989798675544267030253113606","130345329297757728285184125738969805320","264341545616470585950659543305088773577","66949538606836462425556969242045296584","23896047630130579937308876428970594237","159964468411567364216686007088360092079","73823100578944207406783608962683821362","278414836598744056743108478271799274813","227789564377308726349408413781818868997","329688749703719448102262419774949676435","266013658316990204828498679704044572860","129953779942572677059244633505478836627","338673080752462832654093382302761299807","21652074334734829990301300308865295919","59928786327593147953299554998706939337","324873904488268852819090575925336420694","183694359747249620851379903054088154336","115145760300169168359886873158420612594","227349023564596553574641790207815593690","118597724722857341085121257210726014808","223987635961655183533256663691866927190","232226654787372615636250442162391309591","264021983046054881279409086198813017576","108587633537507210242609878158511307392"],"threshold":0.9},"id":"CVE-2026-62958-22ed618e","signature_type":"Line"},{"signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"file":"lib/libriscv/elf.hpp"},"deprecated":false,"digest":{"line_hashes":["128490755209783701476916844480506212671","228413328865779349274733043984999483310","138678118834504270040249060957955778721"],"threshold":0.9},"id":"CVE-2026-62958-28967405","signature_type":"Line"},{"source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"file":"lib/libriscv/memory_elf.cpp","function":"resolve_symbol"},"deprecated":false,"digest":{"length":714,"function_hash":"91764287394318593588576016395460991157"},"id":"CVE-2026-62958-3df5d7bd","signature_type":"Function","signature_version":"v1"},{"digest":{"function_hash":"261776521598285558667170574245874625486","length":327},"id":"CVE-2026-62958-71fbfad8","signature_type":"Function","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"function":"elf_offset","file":"lib/libriscv/memory.hpp"},"deprecated":false},{"id":"CVE-2026-62958-73d3d27c","signature_type":"Line","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/61ef9ca82c8876dd80b33780893ba512af780e93","target":{"file":"lib/libriscv/memory.cpp"},"deprecated":false,"digest":{"line_hashes":["184214360284125919023004501564566776970","202928070238697042276476368286344873898","141989447786591732286501312135399100393","266099118214786341057346237040310695424","309014822940014102744213185273068033192","296615577114993912932200318024116965242","209257247817990601961684516211812339856","290499843462709122378000745345961598769","89296150612330082622195389359657137626","123551509461440288110708041952117235079","155744572746207614286008771854216428096","297299441095429349857993012361318045238","338753056403061792288062947878554960278","81743980161855631387020888740827594750","240290931047465355271140597314185958623","46533352479876714374460231234695260577","24135421000708573567429204094888070945","236706393085488557573442730625586145122","108587633537507210242609878158511307392","50766370940961150590148800333137506420"],"threshold":0.9}},{"source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"function":"lookup","file":"lib/libriscv/memory.cpp"},"deprecated":false,"digest":{"function_hash":"37138338077301417037367654612053646703","length":1679},"id":"CVE-2026-62958-7aecdeff","signature_type":"Function","signature_version":"v1"},{"id":"CVE-2026-62958-81dcff30","signature_type":"Line","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"file":"lib/libriscv/memory.cpp"},"deprecated":false,"digest":{"line_hashes":["185886405256743709692512277681306924467","303841799427394157431407387167351291333","223649513936371174533203490280991190378","146952886848726904205353324919988931106","21371634005976711797642806232486718803","174539538922285217168419181519504098235","68150506020391066408058031259462787586","59009544827067063063082127930729667529","126765843831123510991350003525176837670","17973179845546616772474103038180993723","230749589492809194766626572771540179126","104309919727086493304072034170354779629","194365888543487869306642216344853046432","121789292129296201978399827874718377153","253742366739432445537991189822588530676","101916630885865103866820592486708424165","43176555827806031061349941934695185592","32257819792739050676149323957207683190","298972575546106762366024398610806798908","97108295205410695986451200848756965048","14268871464974357487432509619664641119","201262031617493289002970577508960375547","290117073342858898678428527621677269985","306184601392461262117658741693592835088","198484750103083099992262488175725231293","117361627139902990651238776927018196230","160079030791985907274138906900652838394","272677920765436218818635289888381480817","189602259970067422311255722867555304897","305251076803161402383594942281969601350","114716871323500418961788117168190575885","131422688999808176232317816774744923341","207321222526371534242913237970800509117","253769265476322948493185289638358517933","123791666061189386201007934627094955397","17330109204903178907474393337986581628","7046954500691216392285271508365554122","291940790575609044530732385756719451118","167243039996747747318667871183487195456","168659860816152085478367388661982931217","335960551455554181250235404978494409841","189879930977640536472040292032101347754","240012621951838465541531782943451512473","311321791100072994370544219583274346618","68510631622473996742857131248065087541","277022757630382717078463489678254079238","45786511887448036571091553332118221205","268866224165690370798496078867477537949","88109555349135372466365898834683818101","15676596787691602717171989972653837714","204219936254671768114047424417812411051"],"threshold":0.9}},{"digest":{"line_hashes":["218926308972895496459874647930873118499","68359049338231583426793707652536459664"],"threshold":0.9},"id":"CVE-2026-62958-a1277de6","signature_type":"Line","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/61ef9ca82c8876dd80b33780893ba512af780e93","target":{"file":"tests/unit/verify_elf.cpp"},"deprecated":false},{"digest":{"line_hashes":["186592137420450707122054360682210578115","298923414237594850592057933962182672863","204950598495665454465325543551759659568","287927527587444717653281211466991467141","126349704898024020770033231134420075449","82987074424886348635714077669797426366","142059024001602738023970876103009650186","265309034656956476272558222150693439773","71530794470987288748987046164021192761"],"threshold":0.9},"id":"CVE-2026-62958-abb454a0","signature_type":"Line","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"file":"lib/libriscv/memory.hpp"},"deprecated":false},{"source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"function":"elf_comments","file":"lib/libriscv/memory_elf.cpp"},"deprecated":false,"digest":{"length":933,"function_hash":"159458229907204331719777195729097243510"},"id":"CVE-2026-62958-add235eb","signature_type":"Function","signature_version":"v1"},{"digest":{"length":665,"function_hash":"237192880228447296970533921982748717916"},"id":"CVE-2026-62958-c8ea3c12","signature_type":"Function","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"function":"all_symbols","file":"lib/libriscv/memory_elf.cpp"},"deprecated":false},{"signature_type":"Function","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"file":"lib/libriscv/memory_elf.cpp","function":"relocate_section"},"deprecated":false,"digest":{"function_hash":"46015302456040877197537262110179271766","length":1620},"id":"CVE-2026-62958-ca50b9f5"},{"target":{"file":"lib/libriscv/memory_elf.cpp","function":"all_unmangled_function_symbols"},"deprecated":false,"digest":{"function_hash":"330162935765103487413605696435610762055","length":1041},"id":"CVE-2026-62958-daa9fb42","signature_type":"Function","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa"},{"deprecated":false,"digest":{"threshold":0.9,"line_hashes":["105061354680099609453231873736317362178","22785171295629452104710024689348918916","78263967720767225744557464840558471811","290803448097639794543488730173501009528","240528043116633371900268417502606061647","198648331019771639429424963574193011032","102483470222964096820380498484112267181","277870726920584741380112302214856921822","163198987424372059718138542697941333688","92056491708014004236346803761244124005","326841389084024926337404358792871584177","275663527727418826156171012598518863125","1593721336389359929889389185013940748","201253611787778349514654980181673602198","210970647024931410295177236523325314805","58282181270033465361783420449648606111","161651699787154775554819322512329520520","233175086549054749619662673332998553787","298914143854786147746468900657412945782","80822171501201661238592784507745711407"]},"id":"CVE-2026-62958-fc534e25","signature_type":"Line","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"file":"tests/unit/verify_elf.cpp"}},{"deprecated":false,"digest":{"length":1311,"function_hash":"14218966622056602622773515070473421333"},"id":"CVE-2026-62958-fe9d1922","signature_type":"Function","signature_version":"v1","source":"https://github.com/libriscv/libriscv/commit/7bd1c189f9f9d54368cde096b07b194ad680f9fa","target":{"function":"set_section_file_offset","file":"tests/unit/verify_elf.cpp"}}],"vanir_signatures_modified":"2026-11-04T07:07:37Z","source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-62958.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:H"}]}