Skip to content
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

Friday the 13th JSON Attacks #108

Closed
dungvu-novus opened this issue Oct 21, 2019 · 6 comments
Closed

Friday the 13th JSON Attacks #108

dungvu-novus opened this issue Oct 21, 2019 · 6 comments

Comments

@dungvu-novus
Copy link

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).

FastJson includes type discriminators by default which allows attackers to send arbitrary types. It performs a weak type control by casting the deserialized object to the expected type when object has already been deserialized.
During deserialization, it will call:
• Setters
Should never be used with untrusted data since it cannot be configured in a secure way.

Link full document HERE

@dungvu-novus
Copy link
Author

dungvu-novus commented Oct 21, 2019

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?

@dungvu-novus
Copy link
Author

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" } }

@mgholam
Copy link
Owner

mgholam commented Oct 22, 2019

At the moment just make sure your json is from a trusted source when using the $type extensions.

@dungvu-novus
Copy link
Author

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.

@mgholam
Copy link
Owner

mgholam commented Oct 25, 2019

Check out v2.3.0

@dungvu-novus
Copy link
Author

kindly thank you for support me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants