SQL Injection
Computer Science: OCR GCSE, topic 1.4.12
Structured Query Language (SQL) Injection
Almost all websites today are powered by databases on the server. Structured Query Language (SQL) injection is an attack. The attack exploits these databases.

The attack
- Structured Query Language (SQL) is a language used to access databases.
- SQL injection is a form of active attack that exploits SQL execution on web servers.
- Attackers 'inject' specially formatted code into fields in the website.
- The code is run on the server.
- The code allows attackers to bypass login screens or damage the data kept on the server.

Protection against SQL injection
- Input validation sets username and password rules.
- The rules don't permit the character needed to write SQL code.
- Input sanitation inspects the user's input.
- Input sanitation removes SQL command words from the input before it is processed.
- User access levels can be set up.
- User access levels prevent the web server from altering the contents of the database.
Test yourself on SQL Injection
What type of cyberattack is Structured Query Language (SQL) injection?
A Structured Query Language (SQL) Injection Attack
How does input validation protect a website from SQL injection?
Choose the true statement about SQL injection.
An SQL injection attack succeeds. State the two things this lets an attacker do.