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

[Clarification/For Discussion] Multiple Clarifications for 1.5.2 #772

Closed
csfreak92 opened this issue May 21, 2020 · 7 comments
Closed

[Clarification/For Discussion] Multiple Clarifications for 1.5.2 #772

csfreak92 opened this issue May 21, 2020 · 7 comments
Assignees
Labels
2) Awaiting response Awaiting a response from the original poster

Comments

@csfreak92
Copy link
Collaborator

ASVS 4.0 - 1.5.2 verification requirement is:

Verify that serialization is not used when communicating with untrusted clients. If this is not possible, ensure that adequate integrity controls (and possibly encryption if sensitive data is sent) are enforced to prevent deserialization attacks including object injection.

I would like to clarify from the community/maintainers of this project regarding a few items here:

  • serialization for communication
  • untrusted clients
  • main point of this control

On the first sentence of this control, it is problematic since it says verify that serialization is NOT used when communicating with untrusted clients, isn't it that serialization is always used to communicate from server to clients? I have not seen any application not using serialization between client and server side for communicating with each other, unless there's another way I am not aware of? This part is a bit confusing.

Also, an assumption about the untrusted clients term is for client-side which is usually web browsers, mobile apps, etc., right? I guess if my assumption is right, we could at least add some statements on the V1.5 Input and Output Architectural Requirements some statements explaining the term untrusted clients for clarity of testers/developers.

Lastly, this requirement is a bit confusing whether is it referring to round-tripping of serialized data or is it referring about fresh input from the web browser (client-side)? The reason I guess for the preventative control would depend on what this control is preventing.

Any information from the community would help regarding clearing up this ASVS verification requirement.

@tghosth
Copy link
Collaborator

tghosth commented May 21, 2020

serialization for communication

Maybe we need to be clearer that we mean complex object serialization. i.e. not just take a set of values and considering them like an array or not just taking a simple json structure and reading values but actually passing complex objects which can contain logic.

untrusted clients

Happy for you to suggest some explanatory text for this.

main point of this control

I think this is primarily about accepting input from the client. This could be as a result of a round trip or it could be a new object generated at the client, no?

@tghosth tghosth added the 2) Awaiting response Awaiting a response from the original poster label May 21, 2020
@csfreak92
Copy link
Collaborator Author

@tghosth, please see my comments below:

serialization for communication
Maybe we need to be clearer that we mean complex object serialization. i.e. not just take a set of values and considering them like an array or not just taking a simple json structure and reading values but actually passing complex objects which can contain logic.

Maybe we could clarify that in this control or perhaps in an explanatory text in V1.5 Input and Output Architectural Requirements to reflect this info about what is meant by object serialization here as exactly as you mentioned because most readers would assume sending input and output over the wire? What do you think?

untrusted clients
Happy for you to suggest some explanatory text for this.

Drafting an explanatory text suggestion for this and will reference this issue with a PR that I will create later. If it makes sense to add explanatory text for serialization as mentioned in the previous point, I'll add it as well. Let me know about it.

main point of this control
I think this is primarily about accepting input from the client. This could be as a result of a round trip or it could be a new object generated at the client, no?

I believe this is about accepting input from the client (both a result of round trip values or new objected generated at the client) as well. To prevent deserialization attacks, I would say use hashes or signatures (for round trip values) or encryption on payload/object level. Do you agree with that recommendation for fixing the security issue?

@tghosth
Copy link
Collaborator

tghosth commented Jun 2, 2020

serialization for communication

Feel free to draft explanatory text.

untrusted clients

I will take a look for the PR

main point of this control

I have thought about this more. Regardless of whether we are talking hashes, signatures or encryption, these solutions will only work for round-trip values and not serialized objects from the client. For serialized objects created by the client, we can only rely on a safe deserialization method/process. Do you agree? Do you think we need to reword in light of this?

@csfreak92
Copy link
Collaborator Author

@tghosth, I have submitted a PR for draft explanatory texts including untrusted clients and some explanation regarding serialization.

-> main point of this control

I have thought about this more. Regardless of whether we are talking hashes, signatures or encryption, these solutions will only work for round-trip values and not serialized objects from the client. For serialized objects created by the client, we can only rely on a safe deserialization method/process. Do you agree? Do you think we need to reword in light of this?

Regarding your question about this, I totally agree with you on this that most of those solutions only work for round-trip values and not serialized objects from the clients (which is the usual attack vector). I am not sure whether we should rewrite this to make some sense of it because if we will talk about round-tripped values, that's what was discussed on this other issue I had: #775. If we would say that we can only rely on a safe deserialization method/process, does that cover most cases? If you think we need to reword, please hold my PR for a while and I'll make some changes to accommodate that.

@jmanico
Copy link
Member

jmanico commented Jun 15, 2020 via email

@tghosth
Copy link
Collaborator

tghosth commented Jun 16, 2020

@csfreak92 I made some changes to your PR, take a look and tell me what you think.

@jmanico 100% agree. What do you think about the following change to 1.5.2:

v1.5.2 Verify that serialization is not used when communicating with untrusted clients. If this is not possible, ensure that deserialization is performed safely, for example by only allowing a white-list of object types or not allowing the client to define the object type to deserialize to, in order to prevent deserialization attacks.

@jmanico
Copy link
Member

jmanico commented Jun 16, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2) Awaiting response Awaiting a response from the original poster
Projects
None yet
Development

No branches or pull requests

3 participants