Page MenuHomePhabricator

Backpropagate method links without TaintednessBackpropVisitor
Open, Needs TriagePublic

Description

In theory we don't need a visitor, we can just grab the links from the node, and match them to the provided EXEC taintedness to get a sink taintedness to put on the method. Still have to figure out where such a "matching" method should live, and whether it should start from the taintedness (probably makes more sense, but might be a little bit more difficult) or from the links. Also, there are a couple of things that make this harder:

  • Numkey special-casing (T281479, but see below)
  • Setting EXEC on variables (T281475)
  • getReturnObjsOfFunc. A temporary (?) solution for this might be to get the returned objects in visitMethodCall and merge their links to curLinks.

Doing this would make the backpropagation more precise, and allow us to remove temporary methods such as hasSomethingOutOfKnownDims and getRelevantLinksForTaintedness (which is not very precise). This might also make it easier to use normal backpropagation for numkey taint, so unclear which one should happen first. Probably this one, since there's already some BC/hack code for numkey, so we might keep it around until this is done as well.

Event Timeline

Change 720792 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/tools/phan/SecurityCheckPlugin@master] Backprop non-numkey taints more precisely

https://gerrit.wikimedia.org/r/720792

Not currently working on this. I'd really love to, but unfortunately it's not at all easy.