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

Support "reverse" propagation through Store instructions #291

Open
mlevesquedion opened this issue Mar 15, 2021 · 0 comments
Open

Support "reverse" propagation through Store instructions #291

mlevesquedion opened this issue Mar 15, 2021 · 0 comments

Comments

@mlevesquedion
Copy link
Contributor

Consider this case:

func Test(str *string, src core.Source) {
	fmt.Sscan(src.Data, &str)
	core.Sink(str) // TODO() want "a source has reached a sink"
}

If you're not familiar with Sscan (I wasn't), it essentially splits its first argument (a string) on whitespace and places the resulting strings into its second argument (which has type ...interface{}). (See here for an example of using the closely related Sscanf function).

So, clearly, if the string is tainted, the varargs slice can also be tainted. This slice is implicit, however, and to construct it, in SSA form a slice is made and the arguments are placed into it via Store instructions. Since for Stores we only propagate from the value being stored to the storage location, we can't currently handle this case.

One solution would be to allow taint to propagate backwards through stores. This is likely to cause false positives, however.

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