DEV Community

Discussion on: Where can I find regex to prevent code injection?

Collapse
 
sidrathi47 profile image
Sidharth Rathi

It depends on what cases you want the tool to handle, also you didn't mention about the target you want to protect, is it the DOM, some backend api or something else?

Generally there are different ways to sanitize data and prevent things like XSS

Example github.com/cure53/DOMPurify

Collapse
 
mxglt profile image
Maxime Guilbert

The context is more to have a tool to know if the string contains malicious content

Sanitize will help to protect the app, but I want to be notified if there is a real attack. I want to avoid false positive notifications