Skip to content
Sharp

OWASP Vulnerabilities · interview question

Why is it dangerous to store user input directly in a database without validation or encoding?

Multiple choiceMediumchapter-17-curatedpremiumowasp-vulnerabilitiescross-site-scripting-xss
Choose one answer
Answer and explanation

Correct answer

D. It could lead to SQL injection and XSS attacks.

Why

Storing unvalidated or unencoded user input can lead to SQL injection and XSS attacks, as attackers may inject malicious code that gets executed when retrieved.

Test yourself on OWASP Vulnerabilities

A free test with instant, explained results. No account needed.

Start free test
All OWASP Vulnerabilities questions →