Giter Site home page Giter Site logo

acropalypse-gif's Introduction

aCropalypse gif

aCropalypse(CVE-2023-21036)related GIF PoC. The aCropalypse reported affects PNG, but a similar exploit exists in GIF images.

PoC

This is original GIF Image case02.gif.

Original GIF

And crop image case02_crop.gif using aCropalypse affected software.

Crop GIF Image

Execute acropalypse-gif restore

$ acropalypse-gif restore asset/case02_crop.gif 688 634
asset/case02_crop.gif-restored.gif

Restore GIF Image

Build

cargo build --release

Usage

detect

Detect aCropalypse gif image.

acropalypse-gif detect <filepath>
# undetected
$ acropalypse-gif detect asset/case01.gif

# detected
$ acropalypse-gif detect asset/case01_crop.gif
asset/case01_crop.gif

restore

Restore partical gif image from aCropalypse affected gif image.

acropalypse-gif restore <filepath> <width> <height>
# restore case01.gif
$ acropalypse-gif restore asset/case01_crop.gif 619 232
asset/case01_crop.gif-restored.gif

Run on docker

docker compose run --rm acropalypse-gif detect asset/case01_crop.gif
docker compose run --rm acropalypse-gif restore asset/case01_crop.gif 619 232

Exploit Detail

Algorithm

  • Search Image Data Sub-block. It may be start 0xFF and verify GIF Image Data format.
  • Search 12bit Clear Code of LZW compression(GIF). It may be 0b000100000000.
  • Decompress LZW after Clear Code.
  • Encode image using cropped image palette.

acropalypse-gif's People

Contributors

frankthetank-music avatar heriet avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.