-
-
Notifications
You must be signed in to change notification settings - Fork 679
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
5.3.1 and 5.3.3 seem duplicate #1195
Comments
related issue from past (before v4.0 release, numbers are different): |
Gosh, I can see this has been through a few iterations and I am inclined to agree with Jim that this looks a bit like a duplication. @elarlang do I understand correctly that the 5.3.1 is talking about generally encoding to make things render correctly whereas 5.3.3 is about encoding to specifically prevent XSS? |
To me it seems the recently added 5.3.11 is redundant too:
|
It's not recently added, it has been there since v4.0, just moved to different number (from 1.5.4 to 5.3.11 like the label says) Related issue: #1484 |
I guess I need to go through the history of these requirements, @elarlang do you think they should be separate? |
I'm ok with 5.3.1. Requirement 5.3.3 needs some update, but I think it's not duplicate. Goals here (not covered by 5.3.1):
The term XSS is just... crap, bubble and clearly deprecated (25+ years). Not a single part is true with the name (think about Stored HTML injection - no cross-site, no scripting) and we should not use it anywhere. The term Site in the name is nowadays clear term (eTLD+1) and from JavaScript execution perspective, so-called XSS is more Same-Origin Scripting. And what is DOM XSS? It can be reflected, it can be stored. We should say instead:
Summary - 5.3.3 needs more work and analyze, are all the "XSS" cases covered with other requirements or not. |
Circling back to this issue. I feel like Javascript encoding is covered by 5.3.1 which clearly talks about context relevant encoding for multiple locations including Javascript:
As such, I wonder whether we should rework 5.3.3 to focus on your second point, safe sinks. For example:
Whereas 5.3.1 is a little more generic, this gives us a standard and actionable XSS prevention requirement. What do you think? |
I think 5.3.3 should concentrate for defense against JavaScript injection. Your proposed new requirement as 5.3.3 should be separate requirement (I need to check, maybe we have it covered but need to make it more clear, similar to #1998). It is against HTML execution by mistakes in front-end JavaScript due to incorrect functions in use. Can cover also with front end eval() calls. |
To be clear, you are talking about injection into any context which results in client-side JavaScript being executed? (i.e. what people usually mean when they talk about XSS?)
Not sure I agree that it should be a separate requirement, is it not just another mechanism to prevent JavaScript injection/XSS? |
XSS is not about just JavaScript injection. HTML, SVG, JavaScript and HTML can all cause XSS-centric injection. I know many of you including @tghosth and @elarlang know this already and I mean no disrespect. I just want to explain why I do not think we need a separate requirement for just JavaScript injection. |
Discussed the following draft but @elarlang is going to think about it more [MODIFIED] Verify that output encoding or escaping are used to write potentially dynamic content to HTML, SVG and JavaScript documents to avoid the risk of Cross-site Scripting (XSS) vulnerabilities. |
We have "make the output correctly requirements"
What we need to address separately is when incorrect method is used for displaying the data to the output - e. g. applied as HTML instead ( We have requirement 5.2.4
I would say it is not covering this issue, as the expected defense in this case is not to modify the content to be safe for given usage, but to use correct method for displaying it. So my proposal is:
|
@elar 5.3.3 suggestion 5.3.3: Verify that context-aware output encoding or escaping is used, preferably automated but at least manual, when writing dynamic content to HTML, SVG, and inline JavaScript values to prevent reflected, stored, and DOM-based Cross Site Scripting (XSS) attacks. |
This 5.3.3 is just full of useless noise. It should just say that "escape or encode for JavaScript". If we do that, we should remove the word "JavaScript" from 5.3.1 and I think it can be merged with 5.3.6 (JSON injection attacks). |
Less noise: 5.3.3: Ensure that dynamic content written to HTML, SVG, and inline JavaScript is properly encoded or escaped to prevent XSS attacks. This should be automated when possible. |
I'd like to keep 5.3.3 separate from 5.3.1 since they really do handle different risks at different parts of software architecture. |
I proposed (see #1195 (comment)) to have 3 requirements
|
@elarlang let's discuss on Thursday |
I discussed with @elarlang the possibility of merging two of the above ideas for 5.3.3:
and
I agree that we need to keep this requirement as short as possible but to comprehensively cover "Cross-site Scripting" (I know Elar doesn't like this phrase :) )
I agree with this point and it sounds like it needs to be V50 as it relates to how a particular document or fragment is rendered. @elarlang to work on this |
@elarlang ping :) |
Attempt n+1, the last one. Requirements in v4.0.3:
Requirements at the moment:
Current V5.3.3 is talking about outout encoding and escaping, and XSS. By this wording it does not add much to the 5.3.1, just the word escaping and this is "a hint" to set the focus for JavaScript
In a not clearly communicated way we have here 2 requirements:
The second part was also proposed here #1195 (comment)):
And my comment was, that it is a separate problem: #1195 (comment) Going through all that, I can say that my previous proposal (#1195 (comment) + #1195 (comment)) is still valid. Proposal 1 - remove JavaScript from 5.3.1, as it is covered new 5.3.3:
Although it is not wrong if it stays there, this overlap may cause confusion. Proposal 2 - make 5.3.3 to concenentrate to JavaScript syntax, including JSON (merge 5.3.6). Wordsmithing needed, but idea is this:
remove current 5.3.6 as merged to 5.3.3. Proposal 3 - a separate requirement to "V50.5 Unintended content interpretation" One may say, that if you apply user-controlled data with Parallel example - when an API presents JSON content, but with the header The requirement addresses "display method to use from JavaScript or from your UI framework". Again, wordsmithing needed but I share the idea:
I hope this time it was a clear enough explanation. Also, "content injection" and "content execution" are different things that require different defenses. |
Let's talk through on Thursday |
Proposed requirements:
@elarlang to open PR |
…from content execution
The text was updated successfully, but these errors were encountered: