-
-
Notifications
You must be signed in to change notification settings - Fork 673
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
Add Type Confusion Requirement to ASVS #1617
Comments
Hi @ImanSharaf, I have to say that I think that type confusion and type juggling (as discussed in #1539) seem very similar to me as they both stem from the language making an assumption or inference about the type of a variable rather than the type being explicitly stated. As such, I would be inclined to suggest a combined requirement such as:
What do you think? |
Note to self, there is a discussion in #1539 as to what section this requirement should go into. |
@ImanSharaf what do you think about this wording? |
This appears to be satisfactory. @tghosth |
it is like creating new meal from leftovers...
Maybe it makes sense to combine some "code review" requirements from current V10 (related opened issues #1383, #1468). |
I like leftovers
|
I love leftovers and I'm about to have them for lunch I don't think this is a malicious code issue so I don't really want to categorise it like that. I am going to add community wanted and let this percolate a bit. |
@elarlang @jmanico alternative suggestion, we rename chapter V10 to Insecure and Malicious Code and include a Defensive Coding section in this chapter. What do you think? (Note to self, opened branch: https://github.dev/OWASP/ASVS/tree/defensive_coding) |
V10 will be quite empty after clean-up so it makes sense to make it more abstract, maybe covering all "code-review" related issues which do not belong clearly somewhere else. |
I like the idea of a code review / secure design section for developers. A lot. |
@jmanico we have added Defensive Coding section for now: https://github.com/elarlang/ASVS/blob/master/5.0/en/0x18-V10-Malicious.md#v104-defensive-coding |
I noticed that there is a missing requirement related to Type Confusion. Type confusion is not the same as type juggling which we want to add to the ASVS. In type juggling automatic conversion of data types is the root cause of the problem where in the type confusion incorrectly interpreting data types is the root cause.
While in languages such as C/C++ this leads to high severity vulnerabilities such as CVE-2023-0286 (OpenSSL), in JavaScript language it leads to some serious vulnerabilities too. For example, in this example by Snyk, it leads to sanitization bypass and XSS.
A sample ASVS could be this one:
Ensure that the application handles type confusion by using strict equality operators, validating input types, and being cautious with shared method behavior on different types
To decode the check (for JavaScript language):
The text was updated successfully, but these errors were encountered: