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

Proposal: (sub)category "Client-Side" (browser-side) #1230

Closed
elarlang opened this issue Feb 23, 2022 · 53 comments
Closed

Proposal: (sub)category "Client-Side" (browser-side) #1230

elarlang opened this issue Feb 23, 2022 · 53 comments
Assignees
Labels
3) awaiting proposal There is some discussion in issue and reach to some results but it's not concluded with clear propos 4b Major-rework These issues need to be part of a full chapter rework 5) awaiting PR A proposal hs been accepted and reviewed and we are now waiting for a PR Community wanted We would like feedback from the community to guide our decision otherwise we will progress josh/elar Leaders decision Big decisions, like re-structuring or concept changes V50 Group issues related to Web Frontend _5.0 - prep This needs to be addressed to prepare 5.0

Comments

@elarlang
Copy link
Collaborator

Goal: to cover all requirements, where an application need to check, was a HTTP request made by the browser/client legit or forced by malicious actor from 3rd party site. It includes attack vectors like CSRF, XSSI, ClickJacking, etc.

To which category it should belong, I'm not sure. Just by title, it feels first idea to put to "V9 Communications", but this one seems to be "configuration only" category (the name should say it as well).

Related discussions and issues:

@elarlang elarlang added the 1) Discussion ongoing Issue is opened and assigned but no clear proposal yet label Feb 23, 2022
@elarlang
Copy link
Collaborator Author

Or... to create "Browser communication" (in whatever correct wording) category which should contain additionally:

It even may contain abstract requirement, that don't do any decision on the client side:

@tghosth
Copy link
Collaborator

tghosth commented Feb 23, 2022

So I think XSSI, CSRF, click jacking are "Confused deputy" and could potentially be classified like that. I think calling them HTTP source validation is a little misleading most of the remediation do not involve validations but rather functionality restrictions (e.g. not allowing site to be iframed or not using JSONP functionality.)

I think Cookie security is something slightly different and whilst the different flags could theoretically be in different sections, for simplicity I think it is better that they are together.

@tghosth tghosth added the _5.0 - prep This needs to be addressed to prepare 5.0 label Jun 22, 2022
@tghosth
Copy link
Collaborator

tghosth commented Jun 22, 2022

@elarlang what are our next steps on this?

@elarlang
Copy link
Collaborator Author

depends on related discussion #1220 (comment)

@tghosth
Copy link
Collaborator

tghosth commented Jul 4, 2022

I just asked you a question there :)

@elarlang
Copy link
Collaborator Author

As those requirement did not find their place under V9, we need to have some separate (sub)category somewhere else.

It requires maybe a bit more analyze, is it worth separate category or we can handle it with subcategories somewhere else.

@elarlang
Copy link
Collaborator Author

... or should I just create new category "Client-Side", then start collection all client-side related requirements there and then we can see, how they going to group to subcategories and what is the best name for the category itself.

@tghosth
Copy link
Collaborator

tghosth commented Oct 21, 2022

That seems like a sensible approach. How do you want to handle this? Do you want to prepare a PR or just a list of issues?

@elarlang elarlang changed the title Proposal: subcategory "HTTP request source validation" Proposal: (sub)category "Client-Side" Oct 21, 2022
@elarlang
Copy link
Collaborator Author

elarlang commented Oct 21, 2022

Client-Side

Client-Side is not best title, because in this context requirements are meant only for browser. Communication with API can be done with browser or from another service, so it's not the subject for this category.

It should contain requirements which are handling:

  • Same-Origin-Policy, Same-Site or Same-Origin based restriction or security mechanisms
  • Sending introductions and restrictions to browser, how to handle response

Architecture

TBD

# Description L1 L2 L3 CWE
TBD [ADDED] Verify that separate applications are hosted on different hostnames so as to benefit from the protections provided by the "same origin policy" and the hostname restrictions on cookies. 668

HTTP response headers

# Description L1 L2 L3 CWE
14.4.1 Verify that every HTTP response contains a Content-Type header. Also specify a safe character set (e.g., UTF-8, ISO-8859-1) if the content types are text/*, /+xml and application/xml. Content must match with the provided Content-Type header. 173
14.4.3 * [MODIFIED] Verify that a Content Security Policy (CSP) response header is in place that helps mitigate impact for XSS attacks like HTML, DOM, CSS, JSON, and JavaScript injection vulnerabilities. 1021
14.4.4 Verify that all responses contain a X-Content-Type-Options: nosniff header. 116
14.4.5 [MODIFIED] Verify that a Strict-Transport-Security header is included on all responses and for all subdomains, such as Strict-Transport-Security: max-age=31536000; includeSubdomains. 523
14.4.6 Verify that a suitable Referrer-Policy header is included to avoid exposing sensitive information in the URL through the Referer header to untrusted parties. 116
14.4.7 Verify that the content of a web application cannot be embedded in a third-party site by default and that embedding of the exact resources is only allowed where necessary by using suitable Content-Security-Policy: frame-ancestors and X-Frame-Options response headers. 1021
14.4.8 [ADDED, SPLIT FROM 14.5.3] Verify that the Cross-Origin Resource Sharing (CORS) Access-Control-Allow-Origin header uses a strict allow list of trusted origins. When "Access-Control-Allow-Origin: *" needs to be used, verify that the responses do not include any sensitive information. 183

* Note that 14.4.3 is being separately discussed in #1311

need some nice title here

"Verify that request was initiated by trusted party" and "Verify that the response is readable only for trusted parties" requirements.

SOP and CORS related rules.

Data integrity related requirements:

# Description L1 L2 L3 CWE
4.2.2 [MODIFIED, MERGED FROM 13.2.3] Verify that the application defends against Cross-Site Request Forgery (CSRF) attacks to protect authenticated or sensitive public functionality using the development framework's built-in anti-CSRF functionality or CSRF tokens plus additional defense in depth measures. 352
4.2.3 [ADDED] Verify that messages received by the postMessage interface are discarded if the origin of the message is not trusted, or if the syntax of the message is invalid. 346
14.5.3 [MODIFIED, SPLIT TO 14.4.8] Verify that the Origin header is validated against a defined list of allowed origins to match the desired Cross-Origin Resource Sharing (CORS) policy. 346

Functionality integrity requirements:

# Description L1 L2 L3 CWE
14.2.3 [MODIFIED] Verify that if client-side assets, such as JavaScript libraries, CSS or web fonts, are hosted externally on a Content Delivery Network (CDN) or external provider, Subresource Integrity (SRI) is used to validate the integrity of the asset. 829

Confidentiality related requirements

# Description L1 L2 L3 CWE
TBD outcome from #903 - Verify that JSONP functionality is not enabled anywhere across the application to avoid Cross-Site Script Inclusion (XSSI) attacks.
TBD outcome from #903 - Verify that sensitive information is not present in JavaScript files to avoid Cross-Site Script Inclusion (XSSI) attacks.

Belongs here as well, but need to find good category name

WebSocket

Where to keep V13.5 WebSocket category?

@tghosth
Copy link
Collaborator

tghosth commented Oct 27, 2022

Are you proposing a new chapter with controls that are enforced by the browser?

If so, I have a few thoughts:

  • It seems like the HTTP response headers section + 14.5.3 are server configs which control how the browser enforces security so I agree this is the right place.
  • 14.2.3 is a page value which controls how the browser enforces security so I agree this is the right place.
  • 4.2.3 is a control that is enforced by JavaScript within the browser but not actually by the browser. But it is still client side so I agree this is the right place.
  • 4.2.2 seems like it is in the wrong place. CSRF protection is enforced by the server, the client just has to provide the correct headers, parameters, etc. I don't think this is the right place I would count this as a client side enforced control.
  • JSONP and sensitive data in javascript are not client enforced controls so I don't think this is the right place.

Is that useful feedback?

@elarlang
Copy link
Collaborator Author

elarlang commented Oct 28, 2022

Are you proposing a new chapter with controls that are enforced by the browser?

This chapter should contain requirements, which takes down attack vectors via victim browser. It's more question and being more precise with descriptions and subcategory titles here - but I think that CSRF, JSONP, XSSI ("Confused deputy via victim browser") belongs here - those attacks do not exists without a browser (those are called SSRF then).

Is that useful feedback?

yes, we can move forward

@tghosth
Copy link
Collaborator

tghosth commented Oct 31, 2022

Ok, the idea of attacks which don't exist without the browser is an interesting one...

That is why you want the requirement from #1299 to be in here?

@elarlang
Copy link
Collaborator Author

Yes, it fits to this criteria.

@tghosth
Copy link
Collaborator

tghosth commented Nov 4, 2022

Ok, I think you need to create a label for "big decisions" where we get feedback from the other leaders before finalizing. Do you agree? This issue would seem to match that category

@elarlang elarlang added the Leaders decision Big decisions, like re-structuring or concept changes label Nov 4, 2022
@danielcuthbert
Copy link
Collaborator

Late to the party but really do like the Client-Side category here as it could encompass other facets of client controls

@tghosth tghosth added Community wanted We would like feedback from the community to guide our decision otherwise we will progress and removed help wanted labels Dec 7, 2022
@elarlang
Copy link
Collaborator Author

Back to this issue. This ping-pong has been here now for one and half year. Conclusions:

title: Proposal: (sub)category "Client-Side" (browser-side)

Goal: to cover all requirements, where an application need to check, was a HTTP request made by the browser/client legit or forced by malicious actor from 3rd party site. It includes attack vectors like CSRF, XSSI, ClickJacking, etc.

Agreement for this proposal from @danielcuthbert is here: #1230 (comment)

Late to the party but really do like the Client-Side category here as it could encompass other facets of client controls

As it was more than a year ago, @danielcuthbert is welcome to recheck and revalidate it.

New question (#1230 (comment)) from @tghosth - should CSRF as option 3 belong to the cateogry.

Agreement from @jmanico is here: #1230 (comment)

I would aim for "requirements that do not fit better elsewhere which fit into category 1 2 or 3 from above"

Client and Server issues are very mixed together. I do not think we should be super specific here.

I have not seen any other proposals.

In CSRF issue - the concept got clarified I guess. In JSONP issue it's written it waits for this issue - why, if it does not belong here?

What else is needed?

If I do the math: time-wasted-to-this-issue * average-pen-test-hour-price, it is one really expensive issue already.

@tghosth
Copy link
Collaborator

tghosth commented Nov 9, 2023

At this point, I think you should get the PR done. If you want CSRF to go in there as well then go for it, I agree this has dragged on too long.

@elarlang elarlang assigned elarlang and unassigned tghosth Nov 9, 2023
@elarlang elarlang added 3) awaiting proposal There is some discussion in issue and reach to some results but it's not concluded with clear propos 5) awaiting PR A proposal hs been accepted and reviewed and we are now waiting for a PR and removed 2) Awaiting response Awaiting a response from the original poster labels Nov 9, 2023
@jmanico
Copy link
Member

jmanico commented Nov 9, 2023

At this point, I think you should get the PR done. If you want CSRF to go in there as well then go for it, I agree this has dragged on too long.

Agreed

elarlang pushed a commit to elarlang/ASVS that referenced this issue Nov 9, 2023
elarlang pushed a commit to elarlang/ASVS that referenced this issue Nov 14, 2023
@elarlang
Copy link
Collaborator Author

special mention for @tghosth

@tghosth
Copy link
Collaborator

tghosth commented Nov 16, 2023

I have made some proposed changes and included comments with my logic:
elarlang#4

@tghosth
Copy link
Collaborator

tghosth commented Dec 14, 2023

Elar is working on creating the monster PR for this based on individual commits for each requirement (to help traceability)

@elarlang
Copy link
Collaborator Author

elarlang commented Dec 15, 2023

Elar is working on creating the monster PR for this based on individual commits for each requirement (to help traceability)

my idea is actually a bit the opposite - to avoid monster PR and put the content in with small PRs :)

edit: but the monster arrived...

elarlang pushed a commit to elarlang/ASVS that referenced this issue Dec 15, 2023
elarlang pushed a commit to elarlang/ASVS that referenced this issue Dec 15, 2023
elarlang pushed a commit to elarlang/ASVS that referenced this issue Dec 15, 2023
elarlang pushed a commit to elarlang/ASVS that referenced this issue Dec 15, 2023
elarlang pushed a commit to elarlang/ASVS that referenced this issue Dec 15, 2023
elarlang pushed a commit to elarlang/ASVS that referenced this issue Dec 15, 2023
tghosth pushed a commit that referenced this issue Dec 21, 2023
tghosth pushed a commit that referenced this issue Dec 21, 2023
tghosth pushed a commit that referenced this issue Dec 21, 2023
@elarlang
Copy link
Collaborator Author

The new "Web Frontend Security" category is in place, with temporary number V50.

https://github.com/OWASP/ASVS/blob/master/5.0/en/0x50-V50-Web-Frontend-Security.md

There is still a lot of work to do with that, but for those changes it makes sense to open new issue per topic. As a structure change proposal, we can say it is done.

@tghosth
Copy link
Collaborator

tghosth commented Dec 28, 2023

Great work @elarlang !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3) awaiting proposal There is some discussion in issue and reach to some results but it's not concluded with clear propos 4b Major-rework These issues need to be part of a full chapter rework 5) awaiting PR A proposal hs been accepted and reviewed and we are now waiting for a PR Community wanted We would like feedback from the community to guide our decision otherwise we will progress josh/elar Leaders decision Big decisions, like re-structuring or concept changes V50 Group issues related to Web Frontend _5.0 - prep This needs to be addressed to prepare 5.0
Projects
None yet
Development

No branches or pull requests

6 participants