How can i prevent html injection? Somebody changed the h2 tag text in my website. When i refresh everythings was normal, is an apache configuration issue, help please.
How did you know the h2 tag was changed? HTML injection can happen in many ways but in general:
Never trust user input. If you escape your variables with blade {{ $var }} you are already protected for most of the cases. But there can always be a hole.
If you use javascript and insert variables from something, never use yourElement.innerHTML = someUserData; If you are not sure what the variable someUserData contains.
If someone has access to your server they can just changed your html
@jesusoberdan you can easily change the html if have access to the browser. Right click -> inspect element. Right click the html and click Edit. Now change some stuff and click outside the edit window to save. Hit f12 to close the dev tools. You can do this on all web sites