Skip to content

Commit a1ab4f4

Browse files
authored
Update FunctionIntOverFlow.c
1 parent 8c1f5c9 commit a1ab4f4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Exploits/FunctionIntOverFlow.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@
33
#include <stdio.h>
44
#include <unistd.h>
55

6+
/*
7+
* Brief: Integer overflow in CoreAnimation, CVE-2018-4415
8+
* Usage:
9+
* 1. clang FunctionIntOverFlow.c -o function_over_flow
10+
* 2. ./function_over_flow
11+
*
12+
* Specifically, `CA::Render::InterpolatedFunction::allocate_storage` function in QuartzCore does
13+
* not do any check for integer overflow in expression |result = (char *)malloc(4 * (v4 + v3));|.
14+
*
15+
* The bug has been fixed in macOS 10.14.1 and iOS 12.1, since the interfaces and structure of
16+
* messages are inconsistent between different versions, this PoC may only work on macOS 10.14 and
17+
* iOS 12.0, but it's very easy to replant it to another versions.
18+
*
19+
* Tips for debugging on macOS: Turn Mac to sleep mode and ssh to the target machine, this may
20+
* help you concentrate on your work.
21+
*
22+
* One more: Mach service com.apple.CARenderServer is reacheable from Safari sandbox on both macOS
23+
* and iOS. com.apple.windowserver.active accurately on macOS versions prior to macOS 10.14.
24+
*/
25+
626
static void do_int_overflow() {
727

828
mach_port_t p = MACH_PORT_NULL, bs_port = MACH_PORT_NULL;

0 commit comments

Comments
 (0)