mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
add source for react-hook-form in xss-through-dom
This commit is contained in:
@@ -154,5 +154,21 @@ module XssThroughDom {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An object containing input values from a form build with `react-hook-form`.
|
||||
*/
|
||||
class ReactHookFormSource extends Source {
|
||||
ReactHookFormSource() {
|
||||
exists(API::Node useForm |
|
||||
useForm = API::moduleImport("react-hook-form").getMember("useForm").getReturn()
|
||||
|
|
||||
this =
|
||||
useForm.getMember("handleSubmit").getParameter(0).getParameter(0).getAnImmediateUse()
|
||||
or
|
||||
this = useForm.getMember("getValues").getACall()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user