Repository navigation
[pulse][taint] add the servlet request accessors as sources and the cookie setters as propagators - #2287
Merged
dulmarod merged 1 commit intoOct 29, 2026
Conversation
…ookie setters as propagators The `Endpoint` source on the `HttpServlet` request handlers taints the request, and the values read from it are tainted through the default propagation of unknown calls. This is lost when the request goes through a field and a method analyzed on its own, as in a helper wrapping the request: the summary of the helper does not carry the taint of the caller's request. Make the values returned by the request accessors (`getParameter`, `getHeader`, `getCookies`, `getQueryString`, ...) `Endpoint` sources too, wherever the request comes from. By default, an unknown instance method that returns `void` propagates the taint of its arguments to its receiver. For the attribute setters of `Cookie` (`setPath`, `setMaxAge`, ...), this taints the whole cookie, including its name and value, e.g. after `cookie.setPath(request.getRequestURI())`. Declare these setters as propagators to their return value instead. `setValue` keeps the default propagation to the cookie. On OWASP BenchmarkJava, this finds 32 more of its real vulnerabilities, for 8 more false positives, and removes 161 false cross-site scripting reports.
jeremydubreil
force-pushed
the
java-taint-request-accessors-cookie-setters
branch
from
October 28, 2026 13:51
29a0681 to
3b94a50
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Endpointsource on theHttpServletrequest handlers taints the request, and the values read from it are tainted through the default propagation of unknown calls. This is lost when the request goes through a field and a method analyzed on its own, as in a helper wrapping the request: the summary of the helper does not carry the taint of the caller's request. Make the values returned by the request accessors (getParameter,getHeader,getCookies,getQueryString, ...)Endpointsources too, wherever the request comes from.By default, an unknown instance method that returns
voidpropagates the taint of its arguments to its receiver. For the attribute setters ofCookie(setPath,setMaxAge, ...), this taints the whole cookie, including its name and value, e.g. aftercookie.setPath(request.getRequestURI()). Declare these setters as propagators to their return value instead.setValuekeeps the default propagation to the cookie.On OWASP BenchmarkJava, this finds 32 more of its real vulnerabilities, for 8 more false positives, and removes 161 false cross-site scripting reports.