Closed dungvu-equix closed 5 years ago
I found a warning from README.md:
Security Warning It has come to my attention from the HP Enterprise Security Group that using the $type extension has the potential to be unsafe, so use it with common sense and known json sources and not public facing ones to be safe.
What i can do for this issue?
Parse this json maybe auto call the calculator app run:
{ "$type": "System.Windows.Data.ObjectDataProvider, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", "MethodName": "Start", "MethodParameters": { "$type": "System.Collections.ArrayList, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", "$values": [ "cmd", "/ccalc" ] }, "ObjectInstance": { "$type": "System.Diagnostics.Process, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" } }
At the moment just make sure your json is from a trusted source when using the $type
extensions.
But now I still facing with a security issue with this, I use the json library in server side and I can not ask my client do not send a msg without $type or reject it. And another side, I must use $type prop for polymorphic JSON serializer (that a reason I choose the lib).
I think we should add a solution for these soon.
Check out v2.3.0
kindly thank you for support me
I found the documents from HPE Software Security Research, that talk about a security issue with deserialization method. here all the copy paragraph (from page 5 of file).
Link full document HERE