
1979 changes to exploits/shellcodes Couchdb 1.5.0 - 'uuids' Denial of Service Apache CouchDB 1.5.0 - 'uuids' Denial of Service Beyond Remote 2.2.5.3 - Denial of Service (PoC) udisks2 2.8.0 - Denial of Service (PoC) Termite 3.4 - Denial of Service (PoC) SoftX FTP Client 3.3 - Denial of Service (PoC) Silverstripe 2.3.5 - Cross-Site Request Forgery / Open redirection SilverStripe CMS 2.3.5 - Cross-Site Request Forgery / Open Redirection Silverstripe CMS 3.0.2 - Multiple Vulnerabilities SilverStripe CMS 3.0.2 - Multiple Vulnerabilities Silverstripe CMS 2.4 - File Renaming Security Bypass SilverStripe CMS 2.4 - File Renaming Security Bypass Silverstripe CMS 2.4.5 - Multiple Cross-Site Scripting Vulnerabilities SilverStripe CMS 2.4.5 - Multiple Cross-Site Scripting Vulnerabilities Silverstripe CMS 2.4.7 - 'install.php' PHP Code Injection SilverStripe CMS 2.4.7 - 'install.php' PHP Code Injection Silverstripe Pixlr Image Editor - 'upload.php' Arbitrary File Upload SilverStripe CMS Pixlr Image Editor - 'upload.php' Arbitrary File Upload Silverstripe CMS 2.4.x - 'BackURL' Open Redirection SilverStripe CMS 2.4.x - 'BackURL' Open Redirection Silverstripe CMS - 'MemberLoginForm.php' Information Disclosure SilverStripe CMS - 'MemberLoginForm.php' Information Disclosure Silverstripe CMS - Multiple HTML Injection Vulnerabilities SilverStripe CMS - Multiple HTML Injection Vulnerabilities Apache CouchDB 1.7.0 and 2.x before 2.1.1 - Remote Privilege Escalation Apache CouchDB 1.7.0 / 2.x < 2.1.1 - Remote Privilege Escalation Monstra CMS before 3.0.4 - Cross-Site Scripting Monstra CMS < 3.0.4 - Cross-Site Scripting (2) Monstra CMS < 3.0.4 - Cross-Site Scripting Monstra CMS < 3.0.4 - Cross-Site Scripting (1) Navigate CMS 2.8 - Cross-Site Scripting Collectric CMU 1.0 - 'lang' SQL injection Joomla! Component CW Article Attachments 1.0.6 - 'id' SQL Injection LG SuperSign EZ CMS 2.5 - Remote Code Execution MyBB Visual Editor 1.8.18 - Cross-Site Scripting Joomla! Component AMGallery 1.2.3 - 'filter_category_id' SQL Injection Joomla! Component Micro Deal Factory 2.4.0 - 'id' SQL Injection RICOH Aficio MP 301 Printer - Cross-Site Scripting Joomla! Component Auction Factory 4.5.5 - 'filter_order' SQL Injection RICOH MP C6003 Printer - Cross-Site Scripting Linux/ARM - Egghunter (PWN!) + execve(_/bin/sh__ NULL_ NULL) Shellcode (28 Bytes) Linux/ARM - sigaction() Based Egghunter (PWN!) + execve(_/bin/sh__ NULL_ NULL) Shellcode (52 Bytes)
79 lines
No EOL
4.2 KiB
Text
79 lines
No EOL
4.2 KiB
Text
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1168
|
|
|
|
The dump today has this list of iOS stuff:
|
|
https://wikileaks.org/ciav7p1/cms/page_13205587.html
|
|
|
|
Reading through this sounded interesting:
|
|
|
|
"""
|
|
Buffer Overflow caused by deserialization parsing error in Foundation library
|
|
|
|
Sending a crafted NSArchiver object to any process that calls NSArchive unarchive method will result in
|
|
a buffer overflow, allowing for ROP.
|
|
"""
|
|
|
|
So I've spent all day going through initWithCoder: implementations looking for heap corruption :)
|
|
|
|
The unarchiving of NSCharacterSet will call NSCharacterSetCFCharacterSetCreateWithBitmapRepresentation
|
|
|
|
If we pass a large bitmap we can get to the following call multiple times:
|
|
|
|
while (length > 1) {
|
|
annexSet = (CFMutableCharacterSetRef)__CFCSetGetAnnexPlaneCharacterSet(cset, *(bytes++));
|
|
|
|
Here's that function (from the quite old CF code, but the disassm still matches)
|
|
|
|
CF_INLINE CFCharacterSetRef __CFCSetGetAnnexPlaneCharacterSet(CFCharacterSetRef cset, int plane) {
|
|
__CFCSetAllocateAnnexForPlane(cset, plane);
|
|
if (!__CFCSetAnnexBitmapGetPlane(cset->_annex->_validEntriesBitmap, plane)) {
|
|
cset->_annex->_nonBMPPlanes[plane - 1] = (CFCharacterSetRef)CFCharacterSetCreateMutable(CFGetAllocator(cset));
|
|
__CFCSetAnnexBitmapSetPlane(cset->_annex->_validEntriesBitmap, plane);
|
|
}
|
|
return cset->_annex->_nonBMPPlanes[plane - 1];
|
|
}
|
|
|
|
note the interesting [plane - 1], however if we just call this with plane = 0 first
|
|
__CFCSetAllocateAnnexForPlane will set the _nonBMPPlanes to NULL rather than allocating it
|
|
|
|
but if we supply a large enough bitmap such that we can call __CFCSetGetAnnexPlaneCharacterSet twice,
|
|
passing 1 the first time and 0 the second time then we can reach:
|
|
|
|
cset->_annex->_nonBMPPlanes[plane - 1] = (CFCharacterSetRef)CFCharacterSetCreateMutable(CFGetAllocator(cset));
|
|
|
|
with plane = 0 leading to writing a pointer to semi-controlled data one qword below the heap allocation _nonBMPPlanes.
|
|
|
|
This PoC is just a crasher but it looks pretty exploitable.
|
|
|
|
The wikileaks dump implies that this kind of bug can be exploited both via IPC and as a persistence mechanism where apps
|
|
serialize objects to disk. If I come up with a better PoC for one of those avenues I'll attach it later.
|
|
|
|
(note that the actual PoC object is in the other file (longer_patched.bin)
|
|
|
|
tested on MacOS 10.12.3 (16D32)
|
|
|
|
################################################################################
|
|
|
|
A few notes on the relevance of these bugs:
|
|
|
|
NSXPC uses the "secure" version of NSKeyedArchiver where the expected types have to be declared upfront by a message receiver. This restricts the NSXPC attack surface for these issues to either places where overly broad base classes are accepted (like NSObject) or to just those services which accept classes with vulnerable deserializers.
|
|
|
|
There are also other services which use NSKeyedArchives in the "insecure" mode (where the receiver doesn't supply a class whitelist.) Some regular (not NSXPC) xpc services use these. In those cases you could use these bugs to escape sandboxes/escalate privileges.
|
|
|
|
Lots of apps serialize application state to NSKeyedArchives and don't use secure coding providing an avenue for memory-corruption based persistence on iOS.
|
|
|
|
Futhermore there seem to be a bunch of serialized archives on the iPhone which you can touch via the services exposed by lockdownd (over the USB cable) providing an avenue for "local" exploitation (jumping from a user's desktop/laptop to the phone.) The host computer would need to have a valid pairing record to do this without prompts.
|
|
|
|
For example the following files are inside the AFC jail:
|
|
|
|
egrep -Rn NSKeyedArchiver *
|
|
Binary file Downloads/downloads.28.sqlitedb matches
|
|
Binary file Downloads/downloads.28.sqlitedb-wal matches
|
|
Binary file PhotoData/AlbumsMetadata/0F31509F-271A-45BA-9E1F-C6F7BC4A537F.foldermetadata matches
|
|
Binary file PhotoData/FacesMetadata/NVP_HIDDENFACES.hiddenfacemetadata matches
|
|
|
|
00006890 | 24 76 65 72 73 69 6F 6E 58 24 6F 62 6A 65 63 74 | $versionX$object
|
|
000068A0 | 73 59 24 61 72 63 68 69 76 65 72 54 24 74 6F 70 | sY$archiverT$top
|
|
|
|
|
|
Proof of Concept:
|
|
https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/42049.zip |