Skip to content

[pulse][taint] do not taint the receiver of unknown String methods - #2288

Merged
dulmarod merged 1 commit into
meta:mainfrom
jeremydubreil:java-taint-immutable-string-receiver
Oct 29, 2026
Merged

dulmarod merged 1 commit into
meta:mainfrom
jeremydubreil:java-taint-immutable-string-receiver

Conversation

@jeremydubreil

Copy link
Copy Markdown
Contributor

By default, an unknown instance method that returns a non-object value propagates the taint of its arguments to its receiver. For java.lang.String, this taints a constant compared with a tainted string, e.g. after cookieName.equals(cookie.getName()), although a string is immutable. Do not propagate the taint of these methods: their primitive results are not tracked as tainted either.

On OWASP BenchmarkJava, this removes 332 false trust boundary violations, without changing any other result.

@meta-cla meta-cla Bot added the CLA Signed label Oct 28, 2026
By default, an unknown instance method that returns a non-object value
propagates the taint of its arguments to its receiver. For
`java.lang.String`, this taints a constant compared with a tainted
string, e.g. after `cookieName.equals(cookie.getName())`, although a
string is immutable. Do not propagate the taint of these methods: their
primitive results are not tracked as tainted either.

On OWASP BenchmarkJava, this removes 332 false trust boundary
violations, without changing any other result.
@jeremydubreil
jeremydubreil force-pushed the java-taint-immutable-string-receiver branch from 9c821d9 to 27c8973 Compare October 29, 2026 00:48
@dulmarod
dulmarod merged commit 6e3c556 into meta:main Oct 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants