The root cause: trusting input
Behind the intimidating variety of web vulnerabilities lies a single, unifying idea. Almost every one comes from the same mistake: the application trusts input it should not trust.
An application constantly receives data from the outside world: form fields, URLs, uploaded files, API requests, cookies. All of it comes from users, and some of those users are attackers. The fatal assumption is treating that incoming data as safe and well-behaved, when an attacker can put absolutely anything into it.
The danger has a precise shape. Vulnerabilities appear when untrusted input gets treated as trusted instructions instead of as inert data. If user input can change what your database does, or what a victim's browser executes, rather than merely supplying a value, the boundary between data and command has been crossed, and that crossing is where nearly all technical exploitation lives.
So as we walk through the specific attacks, watch for the same story each time: input arrives, the application fails to keep it as harmless data, and it gets interpreted as a command. Once you see that pattern, the defenses become obvious and consistent, they are all ways of keeping data as data. This single principle organizes the entire messy field of application security into one idea you can actually hold onto.

