-
-
Notifications
You must be signed in to change notification settings - Fork 669
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: requirement for having reasonable timeouts for (external) services #1778
Comments
I think this should be added to 12.7.1:
|
12.7.1 - the focus is - when connection fails, then application should still give at least some answer - so the situation must be handled via error handling the focus for proposed one is connectionpool lockup - every connection must have (relatively short) timeout, maybe also connection pool+queue and when it's full - it already gives response that service is not available, not putting another request to the queue and cause denial of service Idea is to address things like: Here also extra logging requirement that all connection fails and timeouts must be logged. |
I don't agree. The focus on making sure the application still operates correctly that could be providing a sensible error message but also carrying on other operations as well. Please can you suggest a requirement text, I am still not seeing the difference you are proposing. |
Maybe there are even 2 requirements. Connection pool:
Timeout:
|
Time out / CWE-1088We currently have:
The whole point of circuit breaker pattern is to prevent this sort of lockout/lockup when relying on external resources. I think maybe we should just add CWE 1088 to this requirement. Your text seems like an example of the situation covered by this requirement. Connection pool / CWE-410We currently have:
I think your connection pool is similar case to this. but maybe we can add it more explicitly like this:
What do you think @elarlang ? |
If you have circuit braking handled (application does not die from program code logic perspective / the error is handled) - it does not eliminate the need to have timeouts set (and vice versa). Those are separate problems. With second example for me it also combined two different problems to one requirement. In a bit bigger picture - we created new separate section for those requirements, modern applications use external services a lot and those things getting more and more important. Shorter, one problem per requirement, requirements are better in my opinion. |
I personally this this is not necessary and see it more as a functionality vs security problem. Suggest we drop it. |
If we talk about timeouts here - I have proved in pen-test cases it is clearly security issue. If there is some time consuming call to external service, you find the really slow response response build, hammer it, take all resources in use because they don't have reasonable timeout and it's service down. Clear availability issue. |
App level DoS is serious thing. Especially, when there is high SLA and availability requirement and/or it provides service to another applications. For me this vector is underestimated in general and also maybe under-covered in ASVS. Everyone talk about DDoS like just sending huge amount of packets towards application. This is just stupid way to do it. Mostly it's doable with pushing some resource demanding and/or time-consuming service and you can take the service busy. From big picture network level you can not even notice it. |
I try to conclude the situation here:
Those are all separate problems. If you just fix 3 of them, the 4th one is still an issue (for me personally 12.7.2 is the less problematic here, but it's separate topic) |
I think I could get on board with the connection pool requirement. Maybe:
On the other hand, I think the circuit breaker pattern comes to specifically address the timeout problem to the extent that after a while it stops trying altogether We could modify to:
|
For dynamic size there should be also max-limit. If you have "auto-scale" cloud environment and attacker takes resource pool in use, then this constant auto-scale you have later written to the bill as well. Like I wrote before, then circuit braking must only handle the fact that application can give response, if there is whatever connection issue. |
Following discussion with Elar, the current "circuit breaker" requirement is:
This is a slightly reactive mechanism that is basically telling the application to fail gracefully without completely becoming unavailable. Elar's point is that there should be proactive use of timeouts to ensure that a large/complicated query will not run for longer than the timeout and afterwards the resource will be freed. A caveat is that even if timeouts are implemented in the application, the database may still be processing the query and therefore tied up executing it. |
Just for linking update - 12.7.2 in the issue definition is now 12.7.1, and previous 12.7.1 is now 7.4.4 (see e5c4a4b). At the moment it stands like this:
|
So did you still want to add another requirement here? |
@elarlang is this on your todo list? |
yes. I keep labels (at least those that are related to me) up-to-date, so if labels are saying so, it is so. |
I like the idea of moving 7.4.4 to 12.7.2 So far we have
Then moving 7.4.4 we have
|
I think 12.7.1 is more of an API issue and does not belong in 12.x. I suggest this is moved to 13.x. Timeouts are rarely a problem with file upload services or file download and I think it confuses the intent of this section. |
Comment for last Jim's comments:
I need to work through my previous ideas to provide proposals. |
I like the idea of dropping 12.7.1 and all of section 12.7 from v12. Let's do it! v12 is close to being "done" at some level. |
hi @elarlang, can you confirm what the currently proposed action here is? |
Waiting for feedback from @elarlang |
Awakening the monster here... I reworked comments from the issue and made a summary with some new point of views, we can say that this comment is a new starting point without the need to go through the previous comments here. First:
We also have requirement for anti-automation that is closely related and maybe also covering some problems:
The issue is, that connection-pool and resource-demanding or slow-responses you often run under the general "anti-automation" radar. Most likely we need to improve V11.2.2, avoid duplicates, check overlaps etc. Problems to solve/cover:
|
update: to skip long discussion, jump here: #1778 (comment)
Via #1777 we have proposed new category with 2 requirements:
## V12.7 Application Resources
For 12.7.1 there is issue #1748 and for 12.7.2 there is issue #1620.
At the moment it seems we need one more requirement which addresses timeout for connections:
The point for proposed requirement - "when you are able to connect, but you can not get answer with expected time". Personally I think the likelihood for this scenario is much higher than for the proposed 12.7.1 and 12.7.2.
From denial of service point of view - it matters when it is not done for synchronous flow, such as calling some external connection / resource when building response for HTTP request.
It can be problematic for cron-jobs as well, but there it does not increase the likelihood for DoS that much.
The text was updated successfully, but these errors were encountered: