-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Security Issue in Parsing XML using NSXMLDocument #169
Comments
I am told that one should not use |
Andy, Thank you for your reply. It would be awesome if you can use NSXMLParser to patch the security hole. Please let me know when this is available. I will get back in touch with you in a few weeks! Prathap |
Using |
* andymatuschak/master: (170 commits) Adding Thai localizations to the project. Add Thai localization Update to the Brazilian Portuguese localization from Victor Figueriedo Removed Japanese localization of password prompt from the Xcode project Allow the user to try reentering his password if authentication fails. Removing Japanese localization of the password prompt, since I changed the design Delegated password prompting to the update driver. Use NSFileManager interface for DMG unarchive only for 10.7+. On 10.6, [NSFileManager copyItemAtPath:toPath:error:] can fail with "Argument list too long" if the app bundle contains too many files. The switch to NSFileManager was only required for 10.7 anyway, 10.6 always worked fine. Removed changes to the project.pbxproj that were unrelated to the password prompt Redesigned password prompt UI Removed methods from SUPasswordPrompt.h that didn't need to be exposed there Fixes sparkle-project#44: maximumSystemVersion key remove the ASW tags since we're submitting this as a pull request to andy Updating Danish localization courtesy Daniel Østergaard Nielsen support for encrypted disk images Fixes sparkle-project#175: Bug: update alert text collides with automatic download checkbox Fixes sparkle-project#174: Bug: sparkle:shortVersionString ignored for non-enclosure items Fixes sparkle-project#170: An environment variable set by Sparkle Fixing some new Clang warnings from Xcode 4.4 Fixes sparkle-project#169: Security Issue in Parsing XML using NSXMLDocument ... Conflicts: SUUIBasedUpdateDriver.m
Hi Guys,
There is a security issue in the way Sparkle parses the xml. In the SUAppCast.m, in the:
....
document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:0 error:&error] autorelease];
...
}
If the xml file being parsed contains a reference to an external entity, that entity would be parsed. For instance take this simple xml file:
]>
Don't forget me this weekend!+&someEntity;Tove
Jani
Reminder
notice that someEntity is an external entity pointing to some file on disc. This file could be dangerous. In this case it is simply a text file. But the above code that parses the xml document would subsititute the contents of the file when parsing the element.
Please see details of this security risk in:
http://www.securityfocus.com/archive/1/297714/2002-10-27/2002-11-02/0
Instead if you use:
document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options: options:NSXMLDocumentTidyXML error:&error] autorelease];
Notice the use of 'options:NSXMLDocumentTidyXML' instead of 'options:0', what you get after parsing is:
ToveJaniReminderDon't forget me this weekend!+&someEntity;
That is the external entity name has be quoted and hasn't been resolved.
My questions are:
Are you going to address this in your next patch? If so, when will it be released?
If not, can you please provide a way to make this change in the sparkle 1.5 without having to recompile sparkle? That is can we override some class in the application that is linking with sparkle framework to enable this secure xml parsing?
Thanks,
Prathap
The text was updated successfully, but these errors were encountered: