add xss-through-dom source from react-final-form

This commit is contained in:
Erik Krogh Kristensen
2021-02-07 22:47:57 +01:00
parent ff3950ce98
commit 458dda9d25
3 changed files with 43 additions and 0 deletions

View File

@@ -136,5 +136,23 @@ module XssThroughDom {
this = formik().getAMemberCall("useFormikContext").getAPropertyRead("values")
}
}
/**
* An object containing input values from a form build with `react-final-form`.
*/
class ReactFinalFormSource extends Source {
ReactFinalFormSource() {
exists(JSXElement elem |
DataFlow::moduleMember("react-final-form", "Form").flowsToExpr(elem.getNameExpr())
|
this =
elem.getAttributeByName("onSubmit")
.getValue()
.flow()
.getAFunctionValue()
.getParameter(0)
)
}
}
}
}