Had an issue deciding whether to post this here or Security but since it directly affect web browsers...
It seems that most browsers suffer memory vulnerabilities due to the use of C and C++ as the core programming language. It seems that C and C++ do not alert if the written code contains memory vulnerabilities.
The solution seems to be a re-write of the code using a language called RUST which Firefox has been doing for three years.
Here is an article.
https://www.forbes.com/sites/gordonkelly/2020/05/29/google-chrome-critical-security-vulnerability-warning-firefox-update-chrome-browser/#590b33ea1418