I would like to know the risks and possible attack types when using a library (for instance using a UI library for a component) where callbacks can be passed since we cannot control the content of the callback function passed. Based on those attack types what can we do in order to prevent/mitigate malicious code to run on callbacks passed to those handlers? I read several articles about this topic but since I lack experience on this I would really like to have your insights. Thank you in advance