Giter VIP home page Giter VIP logo

webkit-regex-exploit's Introduction

PLEASE READ THIS FIRST

This is currently only patched in the WebKit sources (just to clarify this: Yes, it still works on iOS 12.1.1, meaning every iOS version since 12.0 is vulnerable. There is currently no iOS 12.x version that is not vulnerable. Every macOS version since 10.14.0 is vulnerable as well.) and works with the latest version of Safari (macOS and iOS, although this needs to be updated in order to work with iOS).
Please don't do evil stuff with this.
And if you're a normal user, this will be useless for you.

WebKit-RegEx-Exploit

This is an exploit for the latest version of Safari (as of Dec. 6 2018). Fixed in the current WebKit release, therefore I decided to make this public.
Huge thanks to Samuel Groß (@5aelo) for his awesome Int64 library.
You need to have a WebSocket Server running at Port 5000 or you get "Initialization failed".

Building

If you want to rebuild stage2, cd into stage2 then run python make.py.
For building you need to have gobjcopy installed. (brew install binutils)

The Bug

This is an optimization error in the way RegEx matching is handled. By setting lastIndex on a RegEx object to a JavaScript object which has the function toString defined, you can run code although the JIT thinks that RegEx matching is side effect free.
Exploitation is pretty similar to @5aelo's exploit for CVE-2018-4233, which can be found here.

TODO

Clean up the code a bit, add some comments and do a proper writeup. Maybe even add iOS support? Feel free to create a PR if you want to help me.

webkit-regex-exploit's People

Contributors

linushenze avatar

Watchers

 avatar  avatar  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.