Use after free vulnerability in the String.replace method JavaScriptCore in Apple Safari in iOS before 10.3 allows remote attackers to execute arbitrary code via a crafted web page, or a crafted file.
https://www.exploit-db.com/exploits/41964/
https://support.apple.com/en-us/HT207617