JavaScriptServlet causing noise in various bug bounty programs #157
-
It has come to my attention that less senior security researchers participating in various bounty bounty programs are reporting that when they call an application protected by CSRFGuard and using JavaScriptServlet and the researcher attempts something like (say) https://example.com/myapp/JavaScriptServlet, they see it returning JavaScript source code and they are reporting that as the application's proprietary source code as being leaked!! Apparently they are too busy to note that the JavaScript source code that is displayed is clearly identified as being part of OWASP CSRFGuard Project. Based on the JavaScriptServlet source code, it appears that this is intentional (it will even display the JavaScript code if CSRFGuard is disabled), but this particular behavior is creating noise by it getting reported in various bug bounties because it takes time to triage these and respond to the researcher. (As an example, for a single application, this was reported twice in just a matter of a few days.) So, my question is, is this behavior, especially on GET requests, really needed, or is it just some sort of debugging? And if it is the latter, would it been too much trouble if it looked at some new debug related property in csrfguard,properties and just emitted "Debug is disabled" as the default? Or, if the present |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @kwwall,
In case of applications that require an authenticated session to access the functionalities, the login filter should not allow access to resources (including to the CSRFGuard JS logic) for un-authenticated users. If this doesn't happen, less experienced hunters might think of it as a vulnerability. Either way, this is client side JavaScript logic which is meant to be interpreted by client browsers. Everyone is welcome to analyze the JS code and look for vulnerabilities there :)
This is intentional, indeed. Please refer to #52 (comment)
If
This is unfortunate, and I can imagine it can be frustrating, but this is not a problem of this solution. If the target application doesn't make use of JSPs, the JavaScript logic is needed on the client side to request and assign CSRF tokens.
It is really needed and it is not for debugging.
The
The problem seems to be with the bug bounty program scope and education of people reporting such non-issues. Maybe creating a standard response for such cases and limiting the BB scope would solve this. Because on how CSRFGuard was designed, I don't see a way around this, and even if there was one, changing the architecture of a solution for such reasons simply wouldn't make sense/worth the significant effort. Implementing #31 (JS code minification) could also potentially discourage hunters to report such (non-)issues, but it is not a priority because nobody requested it, and I haven't found a nicely integratable solution to do so either. That being said, as a quick solution, I can do the minification manually and can create a new release with it, if you think that helps. |
Beta Was this translation helpful? Give feedback.
Hello @kwwall,
In case of applications that require an authenticated session to access the functionalities, the login filter should not allow access to resources (including to the CSRFGuard JS logic) for un-authenticated users. If this doesn't happen, less experienced hunters might think of it as a vulnerability.
Either way, this is client side JavaScript logic which is meant to be interpreted by client browsers. Everyone is welcome to analyze the JS code and look for vulnerabilities there :)