stable-diffusion.cpp is a pure C/C++ library for running diffusion model (Stable Diffusion, Flux, Wan, Qwen Image, Z-Image, and more) inference. In versions prior to master-584-0a7ae07, the pickle .ckpt parser in src/model.cpp contained a heap buffer overflow vulnerability in the GLOBAL opcode handler. The issue was caused by missing validation when searching for newline-delimited fields. A crafted .ckpt file without the expected newline could cause the parser to use -1 as a copy length, resulting in immediate heap corruption. The attack requires the victim or application to load a .ckpt file from an untrusted source, such as a downloaded model from a model sharing site. The issue has been resolved in version master-584-0a7ae07. If developers are unable to immediately update their applications they can work around this issue by following these instructions: do not load .ckpt checkpoint files from untrusted sources, and prefer trusted model sources and safer formats such as .safetensors where possible.
{
"cwe_ids": [
"CWE-787"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47750.json",
"cna_assigner": "GitHub_M"
}{
"cpe": "cpe:2.3:a:leejet:stable-diffusion.cpp:*:*:*:*:*:c\\+\\+:*:*",
"extracted_events": [
{
"introduced": "0"
},
{
"fixed": "master-584-0a7ae07"
}
],
"source": [
"AFFECTED_FIELD",
"CPE_RANGE",
"REFERENCES"
]
}[
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "228001765830995913462489836826325648483",
"length": 180.0
},
"deprecated": false,
"id": "CVE-2026-47750-069f2732",
"target": {
"function": "find_char",
"file": "src/model_io/ckpt_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"237757203836965882021922365094362426010",
"197586819065820803022898881132653365734",
"133447650367936732668520802912363829744"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2026-47750-2ca4138f",
"target": {
"file": "src/model_io/tensor_storage.h"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"42625952947728818317440082751145874433",
"67532102538927747525221678078185925386",
"26872512771225625337462152665638362544",
"141002614708271543739925736710659279959",
"77404357282904442645270355583684549192",
"302550418366182082093679366354647315631",
"60522225915984607474033193679830369396",
"327892589527493245484604120312687115702",
"323643213294539723313405651013346828571",
"138217158266693351610785733716437425228",
"203218313828708333586259277655281505572",
"15945319201526166590254258931389199027",
"137972022980463167933485676255970415205",
"326837847791138160123678287039199851772",
"20465025536169167689462007325998757616",
"319897474071683701560866417726660903210",
"325214592888342763159662251257375257196",
"58590557791120843591896598802398425030",
"28410992620600935914717008756401532573",
"20985713815190875306379306579762994742",
"128183180741896977415861268121044915422",
"200348194663521502231042527084737840999",
"43139797324274430631930314331211912705",
"162896642750714977094458763106047171854",
"173718903589850361308088138541585254602",
"37468398246647495891498603819619789196",
"308693261226897777934010912160329963573",
"134661090853722224549521687419344778212",
"248076672658194197696772290579356212703",
"330103819268964848863037912401225645703",
"186953193888140525943858732032985534891",
"74246881390524096979976681333883811992",
"106957372955943332858401507753933382838",
"187184058485696366398437124660059467956",
"178734045518812830777644322162301353861",
"324693543674776810633285044724721431628",
"155708465403677065587776905811968901446",
"132087131405824432944049022606583101812",
"90453793076784140943951312993893042790",
"101172167598038942439109321554956234166",
"329935132350341867310832499803039500918",
"22383014696402144974548802216000581893",
"105206651166843385985969082946589230621",
"188713432116365725977214590349314946514",
"236151642557011100056413866726890359405",
"331907416747110212646255676912758868291",
"128990689583762332774291353439392553185",
"227825898101243252348518458532171065625",
"180856890580343521193469349155247175156"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2026-47750-38c78e09",
"target": {
"file": "src/model.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "122354106344844325235054926985956811669",
"length": 309.0
},
"deprecated": false,
"id": "CVE-2026-47750-491102d1",
"target": {
"function": "read_int",
"file": "src/model_io/ckpt_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "71250369827246707102162498129063558683",
"length": 807.0
},
"deprecated": false,
"id": "CVE-2026-47750-578cb055",
"target": {
"function": "ModelLoader::init_from_file",
"file": "src/model.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"124276238116558141190241339017096725867",
"273665032823497640302720697389104321814",
"313327843533028970985754985989960292284",
"144297084820055695436890168252348180853"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2026-47750-6c7a87e1",
"target": {
"file": "src/model.h"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "282172098589846221198415821176503670220",
"length": 177.0
},
"deprecated": false,
"id": "CVE-2026-47750-96003aff",
"target": {
"function": "read_short",
"file": "src/model_io/ckpt_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "86347000680220176388394807099512672283",
"length": 495.0
},
"deprecated": false,
"id": "CVE-2026-47750-9966e357",
"target": {
"function": "read_u64",
"file": "src/model_io/safetensors_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"174258662389011345058368439457005621507",
"40594772363217994070169506049329940466",
"150004788866058398063888508472505002808",
"59884527387644537113736842533630002383",
"127477026687268772370265575122675699795",
"97624124780378552269231458477775758365"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2026-47750-a1f90206",
"target": {
"file": "src/model_io/ckpt_io.h"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"114447677149058183888906427712298497819",
"77664512627503059049237304258386173555",
"286183645219794266647939853216916125286",
"51425098233445228869242354410004367133",
"48453347620594325921688466282676454643",
"297633073353965775889003722309282935226",
"15549047485068540001750948965876519917",
"95019936925946252182294157629842175423",
"36319874547941221462603814064681740225",
"99893025077873920130896498996908212311",
"47019671342429707826564460759323554191",
"281484916488458321438094226396181661875",
"273444941207662021402214486914471575325",
"40131108885509593244353558424856794510",
"62042015789367816213552516316300488905",
"36851468508534026829004434898555929969",
"118355529124272728116669235136347887038",
"297217385208193891544739075081924327910",
"162145251181574395802585264700284118730",
"76801604317074663206267938771559159780",
"123830209138272090247879900502472063774",
"154554579618781823868966155707004466092",
"30805022276652042512727047512887569001",
"39974067122707319998687072480414592576",
"252363664580124751528602748892460343841",
"155941175319167220992427784326146436779"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2026-47750-a6d10d82",
"target": {
"file": "src/model_io/safetensors_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "149829370758341515500870040816365812702",
"length": 1978.0
},
"deprecated": false,
"id": "CVE-2026-47750-b11b8e45",
"target": {
"function": "parse_data_pkl",
"file": "src/model_io/ckpt_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"239004289534659548485551272882231478762",
"80242958653530429446300040307038393639",
"199744471528589343604377291529062163861",
"300477200659463852336839658419194375517",
"19397766061201672198123297649505346355",
"294264875028764394408745252745839663738",
"187009962088274832226059556389688785143",
"225130832127790144999399713868952741098",
"339202610944227568332207291074276485123",
"314549937778405971304864568176251911788",
"337293934145597348958707099133801575757",
"81840048580265117372628450981952256609",
"310093487136164693177138029869793522538",
"187901409060169415250642183603498296534",
"304351187613803363464607021510574935182",
"105877300817236530946243484817923087262",
"201743890985905856472086667131492202845",
"155284349177213150099705485300838757949",
"7740556357772856694275211820332867236",
"288466307519051437292971475703729198194",
"96694304019258955231785049130006722836",
"131744771710964831235885079369483647513",
"108665026766329716673634977298376223358",
"136716939607054202824105605323069147931",
"187901409060169415250642183603498296534"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2026-47750-c14a27ff",
"target": {
"file": "src/denoiser.hpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "189260086133566964215143638601587542657",
"length": 567.0
},
"deprecated": false,
"id": "CVE-2026-47750-c334e41d",
"target": {
"function": "ModelLoader::init_from_ckpt_file",
"file": "src/model.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "293834170905246243688272709923323401853",
"length": 598.0
},
"deprecated": false,
"id": "CVE-2026-47750-cdd345eb",
"target": {
"function": "convert",
"file": "src/model.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "144804922639526201075070914331346607144",
"length": 872.0
},
"deprecated": false,
"id": "CVE-2026-47750-dd108796",
"target": {
"function": "read_ckpt_file",
"file": "src/model_io/ckpt_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"line_hashes": [
"30928193056597667540781280127613588266",
"322093638753582096785173656182750433902",
"28993343886333646849624166058166620859",
"200996139273186320783528949795151902618",
"275432540288311813752848153806964926150",
"279767662849922684247844151590405010625",
"7914162533976916492013810949412894855",
"260147894487772817944539384226981216595",
"294267274896475505523936678176276592226",
"219166636411220950532230565536833990015",
"117161595884253076724777062463254253304",
"4767780676007091913224723952296167582",
"155038973658636506421841877586878519873",
"283990904134719652927679439508570399038",
"229759829895135967172983416475093316156",
"84068413875016559790823296428708150407",
"125225023123905161650851492435730914901",
"38821052960267382185252479044651053342",
"71547071125448700667046116507336775733",
"235720014204309172426582605791982724168",
"50238303670973479650100827812739752573",
"137504633347491077821052970362856939712",
"236603796137210386104216186545791028388",
"329669881056014441746496477457255640126",
"284204054226543465020423726003623331010",
"119030220509566994221602187402630496276",
"124461481099112751116654687986252189704",
"83567423825101830667408480097641797275",
"114020212306298542643700885042795288126",
"76294723669689383682864940845714035396",
"147814992935508328413750057977070301908",
"222810118118442885009671382063747901745",
"44899589948376480770923429523197231811",
"220782949366866279787156866140630697477",
"98539401014531316230788456194380785703",
"67995289171870193157274039442875364074",
"92571267308060965360612802263809269495",
"90538063168247043999599212561558305959",
"339223709730745722962357283413022508780",
"44129020557262195444475682955132714830",
"273512747552526711123792217581198359326",
"200405983008129662624458473067828388927",
"60895490366291077032884614930605382641",
"93788607332272949284269652561123067571",
"62753790282738401904614895844723237242",
"228828473858560061597931035149452574263",
"298061181470912498387851500771037418263",
"255197622587072728858203184129120596001",
"222354241456146834582598204048204184363",
"5278159512294084934177409709885416136",
"225100035659839178103420753234085943379",
"39248318333466619060783093808505238813",
"143500332278715407208566390237178410440",
"321582594469493977737296820769390755714",
"241217421399612969453462336509414468559",
"319113583609042216063296680895959262143",
"56125921434048304339888173413108940531",
"45396896457898122182848442243160207751",
"56801833168999860684791181283977343267",
"303206089732182705232337374963907345755",
"327228973799784503756178064862003990589",
"87879352583368422295544083505043455773",
"89743682103586535821326744077522037990",
"250437683840117725439284108637660102313",
"259628013173553909034857100584855943966",
"172102645116778085389554935734401858547",
"193945555105656936453847297800470789796",
"323245726785595540969301721676905939070",
"176041848162441646659659023654266678749",
"51853364731994930043089533228317125450",
"334337261795775031617266531296625890369",
"92866185896523913753030385081156805176",
"95431303916101222113025745123289139030",
"303942020363371169791108143740940223247",
"113718310748462680829292320354357937606",
"114174191209979435050238925839499787777",
"106210493611478247472496393364309526800",
"208721315884096544766723289208979756834",
"302776997708563496349620790902062903804",
"158577901348324689754360002443282491265",
"285489161116990015020629747075990081770",
"317257247606132281734449337209201923166",
"326237061597000928810195310300500400777",
"250723233493595857189399580970746146093",
"62065094781657893659922650606971810568",
"168645557651438726454383801615135401050",
"242282075585375071902620561163324325362",
"31064060640904551023405479764444134295",
"243878993264242500987000137626965209407",
"173339198082920791336332109297044435222",
"164715690746924083906932820736324323306",
"24073679722535653141011236501442869470",
"216402888786013939061583257238412930688",
"54940784959720787017768103975238528260",
"160306980991805536652564224449177083316",
"242224236847114107602490548766502077801",
"318225106806696015771147712929222135987",
"299997419108937624433974161652164698794",
"172301482845041952912036001530840944159",
"307432953681914983657919534466409370583",
"74844253208219536375967416451948750247",
"66880478885471850886644137720346867838",
"49259759628709267738995759591855467458",
"11087616134042568263538273140797612308",
"315916334277394585932934512590995272288",
"171929169224617013304617971222857754696",
"230763075280176577164666540182424236093",
"262776785781112680461785546774075140184",
"185761475600719487133500517623549958702",
"51469924641357116350760572238317998812",
"206391183991632542008667005629426080423",
"317299657746041441650624568340216412263",
"9380349059932793679259752944831204104",
"76516736669748070422508923001606064072",
"180695172875155843662437446861906995516",
"259839555155506602518327070771410862046",
"70008756602902493414733300063536011969",
"103100140979164889830116239935557263237",
"250184876836653228472892882012669051303",
"189609634926436284322997657791199784564",
"72114699293254118401387391529547096255",
"143121139624474137479755660008422789602",
"136688298418638334438096889176049352302",
"167740696452586075089212783894239846259",
"248295465149958617709190778074305570393",
"50006816662818022071284192177106037819",
"266975622341661924602176963553756342038",
"211736861346035603607628331665880827179",
"137760982089658597884480274295231054738",
"48366604688918667463180562117153391194",
"63154250914009337636932393714516977473",
"275441293087186758137529757229734088941",
"277181944423155535414422913531020022982",
"74983634492203617257049549367789168295",
"13163766934700385429089769548020034012",
"282222504763010711228728963000436840031",
"91616146436615530925538334992380291457",
"104897562571112093648296376733771060366",
"4902447770414393583784569794449584508",
"116174134295305093322368078645289083608",
"112783490842406143175859161451860077826",
"77121588920349946809142142199107669189",
"262735683330632248171617819956717510922",
"297084456451072919127252642553386213615",
"294369068458155984127386377092405847113",
"149589816878302529196081545782868430100",
"26139979176722891459133439404041155372",
"333277563423255366169961093141828457777",
"240903421375865011206299161312692576825",
"138308218684761338587532531892834496678",
"151289828092964938287619657129067876895",
"217248212753089906540647708695409378976",
"292787933247790504656404222742192134387",
"162626518166349443517135012282815866681",
"290298369292630984589131731701887988814",
"112628415934802626336904877938266970780",
"221144022015265542527741400284863241049",
"266721201433187080999913084979366321428",
"138507306751871345070049311070631551507",
"325982639936448062521116403894533166749",
"111674522716519404722271569994602924805",
"8810516589694179673362835992821480340",
"131655508257070321447647417152449675345",
"66620253989993240603478290599482829165",
"188283010062707907747580479649696939469",
"97745250925130701894738828005037596962",
"223423247733642304781580154138133919431",
"153501186325371069026867980429809792778",
"48111872343634326372686466884500447299",
"331422738917292660534856408970379718843",
"182201221548075974600252556729921210489",
"28311233669340218512528210891403503997",
"284237734358126978036277868178844495235",
"81894750941311400954223076232494031882",
"153312692967403490062712660184124863934",
"196415601597998225246685353008835532122",
"71600430443181212853634064966478368727",
"38167051224704982499828473239602514370",
"330281914299641633058773418158984365099",
"288831638266253750557992158625824924030",
"173306914466352819566516374727383718813",
"168073856040885249483524578964405093388",
"213136141859259972383207209194395188496",
"109570256478566307231840301475588433124",
"258110614741095762045066349075733254050",
"119256325399785433236132497939972320420",
"13905887293488226615137916870036180496",
"166610938844347500841796604334708797251",
"295392806340721406144789802606422255966",
"9028840054126048318031877492002062837",
"266211718957203556288455821810256996550",
"168304472932502658995928872449411753419",
"55324750043941876677202196176979508045",
"289525123005420012073961980965692781711",
"153412043906718429817575663847234181828",
"46826149998194687103120816900419042520",
"153689358277420053468779128495415479488",
"33811564534356714512932978338734446769",
"5455536494888906971883440611925647759",
"214774189658448220229384923066308911267",
"79792776067433063106119403713864889204",
"307645422482223545961008083508236619460",
"136849195616443223599261167880371081215",
"337305682315167954661611633077682768624",
"50202004999078732506260527229906919454",
"141952281995184558961880891023256369819",
"248911131007879313606707643776564433750",
"57214049173683866989983916944288906238",
"92845519283004051011494144437884031860",
"126761615354355069682498085103967884715",
"126244413495195102820846149510201733405",
"49067577071686724059062519103122694713",
"119349916555975111015175924757868500898",
"218439895422894971264994836154567053772",
"239290550834998451771523759364098572302",
"32122820229908081273019779120310807176",
"125801141926790628802758860418119146279",
"2881142162955021246497748889113319792",
"330077586762855843383294162539350785213",
"322127251950480684943321732249631299772",
"156869477211809415842416578267306797488",
"225597789320068444583268042597952315852",
"337325164830572204141389021645720960808",
"308173275321816323819958815274190610707",
"160754108721239462482406803745273754563",
"75379806652795264210612313849964098619",
"294490816255394053495189530829711875762",
"274437138146048204125487217219241807361",
"273044645211350846033584871890401335473",
"163365333947463192760216260292028193514",
"75407180318704451699303769443305508093",
"201813785989310512801353197422550506197",
"63023319149774050960125992398873200987",
"178729662649919707064631884080216003849",
"198518162421555017890189792402813315166",
"10411300158427960015564307383122595007",
"10175277421591135214896299128268116693",
"260606779332814604757537785924054384391",
"122340195816189461033102588996756798780",
"282988320220318256031205267609541725657",
"73762442580120299682759592012838729730",
"263250291338680516443006557755776976896",
"222887938056838036278992038218611081677",
"283086717533456513884003863621421158827",
"71007805844807837521337810500979929356",
"39121566821325685523784216520497453333",
"243788047733268740511256979199621308281",
"81837222456195695248395476756880761698",
"71232454775765730595913329955898051046",
"15868784905032612952095695465893955276",
"137197534355578325698257623930772633340",
"225490420666979678670755636040804323703",
"838387548697439608241963065344344200",
"22065278419023581101112711949523301309",
"183540439997803250623710990156086901903",
"27502209793022594781348903292346764913",
"207081149554474344031959423894706888084",
"52419030786533827519927556560059137566",
"124985815800767276228960211051758332951",
"250336817384647716566955200585257218416",
"209156113944655225476546103716369374669",
"338291020617740268154365806644170559034",
"51449426936907299201471605740080688975",
"330496747525971003329442495436135947457",
"186595260402515593977382598931022188489",
"132551833961791182804096671081317698831",
"319763524757104180280222403069125135095",
"250929191188208667066639599679702106298",
"169029667072219779893246810286675257329"
],
"threshold": 0.9
},
"deprecated": false,
"id": "CVE-2026-47750-e513828f",
"target": {
"file": "src/model_io/ckpt_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "182733607619527597926872348262053989217",
"length": 723.0
},
"deprecated": false,
"id": "CVE-2026-47750-f6ec9fa7",
"target": {
"function": "is_safetensors_file",
"file": "src/model_io/safetensors_io.cpp"
}
},
{
"source": "https://github.com/leejet/stable-diffusion.cpp/commit/0a7ae07f948eff4611968a65a22bd7c7031ad74f",
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"function_hash": "211912674620336809038475977715106288095",
"length": 2869.0
},
"deprecated": false,
"id": "CVE-2026-47750-f953139f",
"target": {
"function": "read_safetensors_file",
"file": "src/model_io/safetensors_io.cpp"
}
}
]
"2026-07-15T17:34:33Z"
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-47750.json"