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

Improve isProducedBySanitizer to detect more cases of values produced by a call to a sanitizer #237

Open
mlevesquedion opened this issue Dec 18, 2020 · 0 comments

Comments

@mlevesquedion
Copy link
Contributor

Consider this function:

func TestSanitizedSourceDoesNotTriggerFindingWhenTypeAsserted(s *core.Source) {
	sanitized := core.Sanitize(s)[0].(*core.Source)
	core.Sinkf("Sanitized %v", sanitized)
}

The relevant part of the SSA graph is:

image

The issue here is that the TypeAssert is not identified as being produced by a sanitizer according to isProducedBySanitizer. We still don't produce a report here because the current propagation code finds the sanitizer and determines that the sinked value is dominated by the sanitizing call.

This incorrect behavior may lead to false positives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant