js-x-ray
js-x-ray copied to clipboard
Detect usage of dynamic RegExps
There is currently a lot of situations where we are missing dynamic RegExps. Ref and examples here: https://github.com/nodejs/security-wg/issues/208
We should probably use the new Tracer to detect those cases (extension, proxy ...).
One major issue if the fact that we analyze files one by one. It make the tracing of Proxies (and similar) impossible.
One major issue if the fact that we analyze files one by one. It make the tracing of Proxies (and similar) impossible.
Can we create an Env class, do an initial traversal of the program's entire AST, storing all the things we should be aware of, and exploit it during analysis?
Can we create an
Envclass, do an initial traversal of the program's entire AST, storing all the things we should be aware of, and exploit it during analysis?
No on multiple files it will cost an insane amount of memory. The only viable solution is to think "multiple iterations"
- First iteration to walk, generate tree and report suspect nodes
- Second iteration: look for suspect nodes
Kind of..