Skip to content

Ideas on how to detect presence of quotes around source in tainted path? #8409

Answered by AndrolGenhald
Kunal-Rex asked this question in Q&A
Discussion options

You must be logged in to vote

You might be able to make a plugin using RemoveTaintsInterface. The AddRemoveTaintsEvent should give you access to the PhpParser Expr which you could check manually, it won't be trivial though as you'll need to make sure multiple variables are handled correctly.

Whatever you end up doing, if you publish it please document very explicitly that it's only safe due to WordPress's automatic quote escaping. It would be very easy for this to turn a true-positive into a false-negative.

Replies: 3 comments

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 Kunal-Rex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants