An issue was discovered in SKALE sgxwallet 1.58.3. sgxdispippsAES_GCMEncrypt allows an out-of-bounds write, resulting in a segfault and compromised enclave. This issue describes a buffer overflow, which was resolved prior to v1.77.0 and not reproducible in latest sgxwallet v1.77.0
[
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "testw.cpp"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-03b3dcab",
"digest": {
"threshold": 0.9,
"line_hashes": [
"48859861374418463189504312338152877573",
"155523991885504943641923916716054474942",
"65184600326243157031220441142028427046",
"208406008174730878721706142413710799712",
"48859861374418463189504312338152877573",
"155523991885504943641923916716054474942",
"65184600326243157031220441142028427046",
"208406008174730878721706142413710799712",
"326664905982477501567918917308748000589",
"155523991885504943641923916716054474942",
"314219541432024553728888517558323809435",
"288771666089606924466306008060152865641",
"223119015566338901844066170430340687878",
"12922928586592794319874818704817565053",
"70482128316750703356747269003927105667",
"8257374089719582695834310276891407042",
"223119015566338901844066170430340687878",
"315267244434487158989138680274741481546",
"50408057425019756062254507389471927308",
"151124385926299472743737820007510608730",
"204964267767969559105943403951216960426",
"285116541361367371722212311361293451519",
"120844703195635743209915759686107286191",
"233899596108300146951205110058071711501",
"103010740232765394292956923179935858736",
"324628894926216856586617993847619792632",
"155770467460669037993303145045301400585",
"175842975174945185486150708514713463422"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "AES_encrypt_DH",
"file": "secure_enclave/AESUtils.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-1a7bbe79",
"digest": {
"length": 679.0,
"function_hash": "265540920493494115559658335455367306091"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedGetEncryptedSecretShareAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-230ebf29",
"digest": {
"length": 1568.0,
"function_hash": "325740874999335323131010492292727471031"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "encryptBLSKeyShare2Hex",
"file": "BLSCrypto.cpp"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-265e5574",
"digest": {
"length": 664.0,
"function_hash": "147529730659001069155130199999658250660"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedGetBlsPubKeyAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-2cddfda0",
"digest": {
"length": 604.0,
"function_hash": "102408352376485495303861107901928420171"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-323b9e15",
"digest": {
"threshold": 0.9,
"line_hashes": [
"46596323397738965125885380224875672938",
"5876573736077494304338632886764104093",
"309128696893900785832572002199855811752",
"41490306822484535333189192440053451990",
"5342381423011613427472120724744252381",
"148388471837782431744776140591284962203",
"93390915993322271143276226197969843745",
"112078980710930599622181872920702445034",
"183697072620806874986360915459329448117",
"59309008504446867367921645376074229379",
"248684845202725081312138239805352740205",
"252151522863383555250198097408721402063",
"334295101894765501218096693882292977068",
"107339621249045454150233553563772041639",
"56707924106958097567098420980003668921",
"47484440501180426988716566497941557962",
"147389563028229045589165239050452480541",
"73540858537465394479904624499126970441",
"167367082955041459490118696453148338354",
"112078980710930599622181872920702445034",
"64717653185028792134487042328444655207",
"239380405620801012860571577658935929911",
"296365835454698353516825162334227907650",
"229170816983910996821145651577770182706",
"53176897332696595669166158856735914891",
"98428978522747687146886606188397785308",
"119091726994666628183424647280464077761",
"166477929847305414500482130819852697970",
"266564520024565493967758708270219608011",
"11104138886993537842695475920062260820",
"276079036357150943283907383856546967048",
"333584370303362788758949618031596935254",
"29136597793569865224346131173612641407",
"110694363718378570561075397627045484910",
"265653147074256229788413022995415265431",
"264038056780217923609883909929844608420",
"319513545089808783945724899578379828516",
"195435785756686885893084237459218411108",
"233188447911971491493630961632509590359",
"191530370302917139594969810372880568491",
"334900307038809093563190786938905762546",
"296630369888765647642273870559155333498",
"64233335930742507284468985984694048548",
"8098786879092526699140510145340906319",
"178943246896453249787859674791502346193",
"225804648712352076324246208984114733231",
"175279229500655073256247157698435131900",
"36848236620550941665819337133213886847",
"278504738550107199585286215304164886590",
"220652071114425170430655099452137769739",
"103719119419196658071571046596886046978",
"109196978425534002730938405598281961470",
"240540028050912200802726734521878581053",
"256810960138895632129462164508788722118",
"209198009802337779841728769202938704466",
"218543157456574729475623487326225103256",
"239148187839709544196249607541388564107",
"131741854451717121449320925100930208101",
"320699721369914052903884485687436586610",
"226206765412579033677875142602810740814",
"174575093347417256389209029713508040570",
"28840248654279578364181126338704121913",
"150209471319464632811639592712510856610",
"85262969826997959545783917553392341388",
"268676804091569963344075061460640984426",
"140181085849616146644109087284173146580",
"307917425393660457494568447846979242134",
"109663017353132109565528495730402688835",
"250148971844185123779798855280186045398",
"132790320942028169729305118102771898652",
"116893060143033520999328131673297577856",
"83477437405738376414471197239369550375",
"6660781308745036805329954899146665992",
"155455455722271935813486952504223951246",
"337271263731739181666266533578775291511",
"246561632833731602833072597887497730645",
"247055620361921714975477570488010650961",
"324623661970016845696342840786215834826",
"262195050693326160042613138669074130260",
"208167931928065412208634349171577536429",
"196998812529941692252851284406691777105",
"238964299688542060550101424171491644534",
"66891809909071272809966712485503616552",
"126466912832713657342438390374172259836",
"76838972905546457687232662350118609441",
"164659888653640438196597001324808020017",
"205494194845423033487496068883725749556",
"105231021433493469634513097562505324040",
"289407505517326758833276092620845057909",
"129998456656737355982466010845989659929",
"293959449485371866454642627588233306609",
"81228659136548058096927235127109118439",
"114802611938199990943273764453613030467",
"221508472443006860656488710844926070967",
"146443998304691959216187312647799675058",
"85956278473905866811912583381707550806",
"248607912401768888044005743576558437008",
"159675053698029841147228704817441445686",
"315682801444846141022337407848474277967",
"270781536924197915697813960446893196472",
"181811065825699438338406079755991771547",
"264652705480142495564426886493689877558",
"17092004812458074412089037673776474083",
"28606631658362690435341761778613519471",
"19109202039393222378967457187291221200",
"103333682149138937411035916226999558492",
"277671451241699627245206497873533450707",
"108939017888652544184143299287578013011",
"225980071060290405631401079981318975727",
"117857985899030684141828549628772117626",
"307907066435566039954722933889639492501",
"318455115222021810359339633373874449515",
"237300420110413460749393703339765398153",
"207332805488922819062388922463457330462",
"13185560824513345153232878006761211403",
"142266631499739982431822828771279522221",
"215348649879620808263655014847109426592",
"303274777024163274307368089246278727159",
"100654522324050322173266386714379144241",
"68659735886296399552827714812827010645",
"304482161040744300786817293533341422347",
"175690035693736896661904538813420979268",
"102859660776259566072290295007557960153",
"52267835577552399010106176527103983901",
"331016585139023587159763551899266883695",
"111745949444946210830901422842091760452",
"238444519225355665262685576540512157870",
"325673962023148653477158536062631720912",
"108950151520998055830887859572856861638",
"95621827674800530123476750387576119584",
"122477099144408634726928031457441571438",
"315385640463277784605682854611457432358",
"128076699789526757486647345028960608726",
"51084663951089406549404713303775599609",
"18861122359101171050275832394691881270",
"236416015096823377802232797119397840436",
"119751779308812535539194686321636801112",
"310515672867796484974623763530796770247",
"123027457575628701939765171785988486011",
"181998451255530166730673593192445360805",
"57933358478629862213292686617917534328",
"171137595141096386219329332344124754424",
"130002525630315716589874652623126305453",
"24963927496087778474221062831032060525",
"166237764008688797545616417228289259954",
"32002434201699406444584403974056099048",
"107076782011865236075304994629320147430",
"70763654747644058377991011264554395390",
"298937416208542333011076195578505862766",
"326421927808946809137251483499063199264",
"178898595748038730232821615631931547119",
"223198149823288434095994433770785671869",
"324351156433726840887722304197865375344",
"299527741564460647414794636547386593168",
"215096224417654708440479640028254150250",
"141092178770043683832908281594844233950",
"106508583316301616020113715567305981273",
"241340358072319269102425869815884784652",
"131294380446247146043047563483879177563",
"151625012321206143721921531745733089605",
"94854272565125177718655739404917929278",
"166141724883768613271058477944264291661",
"120196960007214209619750297323077266899",
"242070851617253091810222197455362505996",
"209162677125577396423540972813369615632",
"80869687718247513622464418330747802124",
"14304301615208459877357879986217969645",
"330858632663188171850856337564484969849",
"266962860137804589537776703490426362802",
"183164931422173486402538809758974745292",
"179560699313088869884121242041937900559",
"146779481332325081739643811745497536766",
"157007770665188266994734399595261295752",
"254988041322211686129458926825876206421",
"173277882857977692004013432350360408634",
"803694537302297680414196370704821332",
"46543479620461630442365349368613462478",
"195024729776861280967957928901434618483",
"207710115974415605537619825202361962447",
"71179072581096034233844046393852150650",
"21217859869585727728934792236557793651",
"195514798094756329694128167677325348782"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedGetPublicEcdsaKeyAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-3b138d61",
"digest": {
"length": 1551.0,
"function_hash": "76692206530587062695554063529206909247"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "SGXWalletServer.cpp"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-3b6766ac",
"digest": {
"threshold": 0.9,
"line_hashes": [
"270456962299359236802162933066092317089",
"198291216619642541851206787893634052095",
"39921027062829034731948799993387126442",
"227070984652806331266116462506202017462"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "AES_decrypt_DH",
"file": "secure_enclave/AESUtils.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-53dec469",
"digest": {
"length": 753.0,
"function_hash": "152586471680359122514539852947172770969"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "SEKManager.cpp"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-6c754dbd",
"digest": {
"threshold": 0.9,
"line_hashes": [
"308970448771960442027954312639017271299",
"320836139420634099488340681257808329690",
"192307046641445283206889803840478606381",
"243761745340965954609925303461267740987",
"85971064343686310022150805242470966863",
"8477728661453511943975852464810952249",
"305935628006635248880200153144102498766",
"224780891421609535406822974606004581513",
"97206191965164914670497365666009761833",
"171223003528211542286379035323333730367",
"312455871383070792341283648956281083369",
"105459294919706526502629450049846252051"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "secure_enclave/AESUtils.h"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-6dfb8b86",
"digest": {
"threshold": 0.9,
"line_hashes": [
"238764621924990715914901963091929252812",
"48513806090167906902676561911706965245",
"284649306802465707258218782732503940790",
"112402247240666177287574755654229580426",
"8826321136344995594347312620215135232"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "SGXWalletServer::calculateAllBLSPublicKeysImpl",
"file": "SGXWalletServer.cpp"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-6f333a05",
"digest": {
"length": 1235.0,
"function_hash": "131664263053894831598387597763834127604"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "DKGCrypto.cpp"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-7003dd0c",
"digest": {
"threshold": 0.9,
"line_hashes": [
"268103128646229826389273607947616207618",
"228768671658326457506371799593969128522",
"125125711945293343280191776385935754822",
"122672873222885346926430392731168355987",
"128782795995590988902009274057447064325",
"297644548537684082678779531938125453983",
"303600459049018283551077397252398816526",
"20552974133499442619990475487668563718",
"1492378050411784255748546976432615103",
"258243231079957411829906224633368549328",
"265102213360363627876135742434091297177",
"48555311211306941548493080378078701180",
"336786680841518862485200051612966140639",
"306876049612250449026350897428915589361"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "secure_enclave/AESUtils.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-72104a68",
"digest": {
"threshold": 0.9,
"line_hashes": [
"238515843948303046844836943741865559051",
"108182025232682919909806834732403547302",
"255857440455047862340696848866578096537",
"295411845148825219751692770002023593368",
"65741942853579504313087050126867752772",
"186910339530130862232997767920016709170",
"15854515277476830124951253944320556058",
"243332124434963594032472865943470070121",
"153842211976394243701564310407656428101",
"228071969620609616704223389205989266143",
"320632569980938689150994221013181315235",
"141296159914905835951215014715627745768",
"154827450135054061551855331418272121903",
"321518527862506619966612986147774392360",
"209030945969085198223661941825003085822",
"4575585105086547561049179631920353254",
"57991023320528867723856569203860578778",
"36592450991947199082775295036306161813",
"2494979228760166274758741285709354339",
"192599744521839943359321006967239231355",
"36592450991947199082775295036306161813",
"2494979228760166274758741285709354339",
"141538742554260015562503473949543142351",
"264344392675050798978962716693809868486",
"203340358487465536653314303704659750272",
"205395917481313582276578955925005860274",
"95616676350465780880091598931136725098",
"288360612267733002062311848373989772616",
"25892512684252846764673078889873615173",
"311767509866426191343214062403404380429",
"32677485487351061518503833824051511016",
"73316368553840376477879430010730529538",
"243332124434963594032472865943470070121",
"153842211976394243701564310407656428101",
"228071969620609616704223389205989266143",
"320632569980938689150994221013181315235",
"141296159914905835951215014715627745768",
"237456902998327384047990042297466420113",
"165734115022732065310778528497549495269",
"60017561319305500279806837295242985505",
"41053559291280883865908216602173418767",
"57991023320528867723856569203860578778",
"36592450991947199082775295036306161813",
"2494979228760166274758741285709354339",
"298342792537507908005280020433245993859",
"119256162849253659357243487307611341614",
"174605920654213848115524739292201093972",
"257789052754690042259867089278560992056",
"95616676350465780880091598931136725098",
"288360612267733002062311848373989772616",
"25892512684252846764673078889873615173",
"311767509866426191343214062403404380429",
"32677485487351061518503833824051511016",
"22731791576680571983369956840634186648",
"42095737994936102809445947528289236892",
"45577228516205542254670367294543263429",
"297920620622767177471613066470559046554",
"206160753447583266034948869351495084546",
"205866154976273785098707195118981266046",
"55678041572382883428753617635377475000",
"137008351957012489510926032301871353895",
"96205517562300830198171222620104100071",
"194986839442085302088472111628621224639",
"313102955414832896132655076659313881736",
"184199534950756075951459780504511730322",
"34450279656648510065884906468383350872",
"218095110182411893857054834447308334585",
"109941311152562396433397501652059186793",
"36592450991947199082775295036306161813",
"2494979228760166274758741285709354339",
"284504264053713917616676695607316571561",
"284287810814011684760315708757834678040",
"225565086248260005120514153111194620308"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "ECDSACrypto.cpp"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-73bb05b7",
"digest": {
"threshold": 0.9,
"line_hashes": [
"196415345231410346103009723976039124",
"117077756052577272276432534361304933450",
"314051943963356776226389631001952443551",
"334446230876639063999909976341485203227"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedEcdsaSignAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-7c13b960",
"digest": {
"length": 1728.0,
"function_hash": "116708673666988032116152512679576809281"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "AES_decrypt",
"file": "secure_enclave/AESUtils.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-878715ac",
"digest": {
"length": 744.0,
"function_hash": "101878297264672790945215008927470817242"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Line",
"target": {
"file": "BLSCrypto.cpp"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-acdb16db",
"digest": {
"threshold": 0.9,
"line_hashes": [
"107061916504282547312840744053088627073",
"116619403616602792788582384917008297154",
"80724072372126832638786536117727556509",
"317334508725129465364533951615960750169",
"12640420216304643059878417609553956647",
"274988277214972978977261285640646583813",
"57820435701578703511094342874029089117",
"156107480567167113345355024016918570484",
"7259562935014178475020404338451403007",
"152395744302866468403948640882367571564",
"203766746388648265872885945034758191657",
"164979726991107426469831550245047774401",
"244274874102980577295770441014186774376",
"320712197188362887034498436120699111938",
"250022073466597397464532922426835074441",
"318053793867057721173258009915741071815"
]
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedGenDkgSecretAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-d0ac1422",
"digest": {
"length": 902.0,
"function_hash": "271954102424503991781281627230455920653"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedEncryptKeyAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-d1426066",
"digest": {
"length": 1063.0,
"function_hash": "34784424304606121483701894938088269776"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedDkgVerifyAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-da780b1f",
"digest": {
"length": 1100.0,
"function_hash": "211479967577694287221242501307892008439"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedCreateBlsKeyAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-db9b4b54",
"digest": {
"length": 2206.0,
"function_hash": "158721006198012118959706093961768931154"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "trustedGenerateEcdsaKeyAES",
"file": "secure_enclave/secure_enclave.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-dd14b44e",
"digest": {
"length": 1863.0,
"function_hash": "240712294785615911136871577852344681084"
}
},
{
"source": "https://github.com/skalenetwork/sgxwallet/commit/77425c862ad20cd270d42c54f3d63e1eb4e02195",
"signature_type": "Function",
"target": {
"function": "AES_encrypt",
"file": "secure_enclave/AESUtils.c"
},
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2021-36218-eb6398b6",
"digest": {
"length": 670.0,
"function_hash": "31435309886153944005023126246044691609"
}
}
]