-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
proposal: 1.12.2 (50.5.2) move/merge to 12.5.2 (50.5.1) #1406
Comments
Why did you reopen @elarlang? |
Only CSP part remove quick-fix is done, merge to make. |
Requirement history:
The item was originally added in commit 7809c0b. Based on the discussion in #455, it sounds like the main purpose was to promote sandboxing and not just for XSS but in general. I would support keeping this as a separate requirement but moving it to section 12.5 as a practical/implementation requirement. |
Mapping it here: #1009 |
Suggest a small grammar change for 1.12.2 (please do not use dashes in requirements, they are not proper punctuation).
|
Update: those requirements are moved now to the Web Frontend Security category: V50.5 Unintended Content Interpretation
Proposal to merge them is still valid. |
So we now also have:
This seems to replace 50.5.1 definitely. What about 50.5.2? |
@elarlang any idea what the next stage is here |
The next step is to build a requirement for addressing the attack vector, that an attacker can upload a file that causes a so-called XSS attack in the same origin scope when accessed directly or served incorrectly. But to have the brainpower to do that is another question. |
Do one of these work for you? Verify that user-uploaded files, if required to be displayed or downloaded from the application, are served by an octet stream downloads and from an unrelated domain, such as a cloud file storage bucket. or Verify that user-uploaded files, if required to be displayed or downloaded from the application, are served from an unrelated domain, such as a cloud file storage bucket, to mitigate XSS and other security risks. |
From @tghosth in #1406 (comment) about 50.5.3
The more I try to solve the issue, the more I also lean towards a solution to merge them all into one requirement. As the principle is already covered, we should spotlight the uploaded files issue in one example at the end of the requirement. This requirement can be long - it covers so many edge-cases and there are so many different solutions to achieve that. |
How about one of these? Verify that user-uploaded files, if required to be displayed or downloaded from the application, are handled in a manner that ensures they cannot be executed as HTML or JavaScript content. This can be achieved by serving files as octet-stream downloads with appropriate Content-Disposition and Content-Type headers, or by serving them from an unrelated domain (such as a cloud file storage bucket), to mitigate XSS and other security risks. or Verify that user-uploaded files, if required to be displayed or downloaded from the application, are served in a manner that prevents execution as HTML or JavaScript content. Files must be delivered either through octet-stream downloads or from an unrelated domain (such as a cloud storage bucket), with appropriate security headers and validation mechanisms to mitigate risks such as XSS and MIME-type attacks. |
The overlap with 50.5.3 is quite big - the only recommendation that is different is that "serve the content from other domain". Although it takes the same-origin vector down, I'm not sure we should mandate or allow HTML or JavaScript execution from other domain. If there is no reason to execute it with direct HTTP request, then it should not happen. |
haha so now we also have 50.5.4. Reproducing the whole section here:
|
@elarlang how many requirements do you think this should be merged down to? |
50.5.1, 50.5.2 and 50.5.3 are for situation, if an HTTP response is executed as HTML or JavaScript (or anything else). Those 3 can be merged to one requirement. The question is mostly, should we have a separate requirement for uploaded files to highlight the widespread issue. 50.5.4 is a separate thing - it is more related to, how dynamic JavaScript builds the HTML document. |
Agreed on 50.5.1, 50.5.2 and 50.5.3 merging. How about: Verify that user-uploaded files are never executed as HTML or JavaScript, are served as octet stream downloads or from a separate domain, and implement controls (e.g., Content-Security-Policy: sandbox, Content-Disposition: attachment) to prevent incorrect rendering by browsers. |
Jim - you are cutting so many details and keep proposing a separate domain. Please read previous comments. I prefer we just cover 50.5.1 and 50.5.2 points into current 50.5.3:
edit: finetuned the last sentense |
Sorry @elarlang was moving too fast. I like your version. All is well. |
Tags (the idea: 12.5.2 was moved to 50.5.1 and other 2 requirements were merged into it):
|
ping @tghosth - please recheck before I hit the PR. |
@elarlang that all makes sense to me |
Related issue:
Implement a suitable Content Security Policy (CSP) to reduce the risk from XSS vectors or other attacks from the uploaded file.edit: CSP part is now removed from the requirement text.
CWE-646 - Reliance on File Name or Extension of Externally-Supplied File
Current requirement contains many parts:
CWE-434 - Unrestricted Upload of File with Dangerous Type
Proposals:
The text was updated successfully, but these errors were encountered: