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

Ensure summaries of un-analyzed functions are sufficient #9

Open
amzn-jasonrk opened this issue Jun 22, 2023 · 5 comments
Open

Ensure summaries of un-analyzed functions are sufficient #9

amzn-jasonrk opened this issue Jun 22, 2023 · 5 comments

Comments

@amzn-jasonrk
Copy link
Contributor

Some functions could behave in ways that individual summaries of dataflow and escape are insufficient to capture taint flows, when the body of the function isn't analyzed:

func leak(p *string) {
	pkgGlobal = p
}
// in standard library, so taint doesn't see function bodies:
func ok(x string, p *string) {
	*p = x
	leak(p)
}
func bad(x string, p *string) {
	y := "abc"
	q := &y
	*q = x
	leak(q)
}

In this example, ok function doesn't have an issue, because the dataflow notices x flows to p, and the escape notices that p escapes. In the bad function, the dataflow doesn't have any edges (as p is unused), and the escape analysis doesn't report any escapes of arguments, so taint would be lost, even though it can flow to a shared object.

This problem only occurs when the dataflow cannot see the function body; if the taint analysis sees the function body it will see the leak of a tainted value q.

To solve this, some kind of summary that includes the effects of dataflow and escape together seems necessary, i.e. an edge from an argument to a virtual "escaped" node in this case.

@victornicolet
Copy link
Contributor

This issue is still relevant as we continue integrating the escape analysis to the dataflow analysis.

Copy link

Stale issue message

Copy link

github-actions bot commented Apr 9, 2024

Stale issue message

Copy link

Stale issue message

Copy link

Stale issue message

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

No branches or pull requests

3 participants