-
Notifications
You must be signed in to change notification settings - Fork 229
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
NSCoding cyber security issue founding #308
Comments
You'd better transfer this issue to https://github.com/SDWebImage/SDWebImage/issues For fixingWe don't know your Type of associated object. See 'sd_extendedObject' documentation So, this need a API break changes (You, as a user, now need to pass extra params for SDWebImage with your Type/Class) and need SDWebImage 6. |
thanks for the response. I see that your latest SDWebImageSwiftUI git uses 5.19.1 that is not 6. |
just found that latest SDWebImage is 5.19.1( 6 does not exist). Do you guys know that when we use WebImage(url:); based on my search with sd_extendedObject, it said, "By default, if the image is cached, we do not send request to query new metadata.". the most important question is that whether SDWebImage use NSCoding or not by default when user use WebImage(url:) |
This API seems for advanced user. If you don't know what's that for, you will never trigger the NSCoding code (which means, Your app will never has this security issue) |
Only when you use something like this one ( I guess no one except me use that): https://github.com/SDWebImage/SDWebImageLinkPlugin It may trigger the NSCoding archive/unarchize cofe |
thanks for the contribution on your git. we are currently using it ; WebImage(url
However, we found that there is some cyber security issue(NSCodin) on your git repository and I just wonder if your organization have a plan to convert NSCoding to NSKeyedArchiver in a near future; if you have don't have any capacity to fix soon, it would be appreciated if you could response saying that you don't have plan on it now. Then, we could keep using your repository; otherwise, we have to drop it off unfortunately. Looking forward to hearing from your organization.
Thanks for your time and your contribution to our development community is crucial.
Best Regards,
Peace Cho.
Here is the founding
The
NSKeyedArchiver
orNSKeyedUnarchiver
methods used by the App are insecure because they are incompatible with theNSSecureCoding
protocol. An attacker-controlled payload that is deserialized via these APIs may result in attacker-controlled code being executed.NSCoding
is an Objective-C protocol that interoperates withNSKeyedArchiver
andNSKeyedUnarchiver
. Together, these APIs allow serialization and deserialization of code objects. However, theNSKeyedUnarchiver
methods used by the app, and theNSCoding
protocol itself, do not verify the type of object upon deserialization. Thus, an attacker may craft a malicious payload that results in unexpected code being executed.To mitigate this vulnerability, Apple introduced the
NSSecureCoding
protocol along with the following secure methods ofNSKeyedArchiver
andNSKeyedUnarchiver
, which are robust against this type of attack:These APIs protect against object substitution attacks by requiring the programmer to declare the expected type of object before deserialization completes. Thus, if an invalid object is deserialized, the error can be handled safely.
Apple provides more information in the WWDC20 session, 'Securing Your App'.
here is the
Remediation Guidance
The text was updated successfully, but these errors were encountered: