Skip to content

The TaintFlow blocks in an .ERB file #14875

Answered by alexrford
Sim4n6 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Sim4n6, we handle a similar case in the XSS queries but haven't yet expanded to be a general case flow step. You can check out the isFlowFromControllerInstanceVariable predicate in XSS.qll to see how we implement this.

I'll warn that the implementation is a bit messy - in general terms we're interested in matching up with the correct template file, then matching up an appropriate InstanceVariableWriteAccessCfgNode in the controller with a corresponding VariableReadAccess in the template file. We use the Cfg layer for the write to check that the variable isn't then overwritten before the render call.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Sim4n6
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Sim4n6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants