liveBook · Manning

SQL injection

Also called SQLi

SQL injection is a security flaw or attack in which untrusted input is interpreted as SQL syntax, altering the intended structure or behavior of a database statement.

How 12 Manning books explain it

Acing the Frontend Interview

SQL injection is an attack that manipulates database queries through unsafely handled input.

How it is used
Frames SQL injection as a security risk when processing HTML form submissions that interact with databases.
How deep it goes
Names the risk and recommended safeguards but stops short of a worked attack or query implementation.
Examples
Uses a form-security interview question rather than a concrete SQL query or attack example.
What you can do after
Evaluate/understand it as a form-processing risk and identify parameterized queries or prepared statements as the database safeguard.

Read how Acing the Frontend Interview explains SQL injection →

Build Python Web Apps with Streamlit

SQL injection is a security vulnerability in which attacker-controlled input alters a database statement to execute unintended SQL commands.

How it is used
Uses parameterized queries to protect a Streamlit app’s database operations from attacker-controlled input.
How deep it goes
Defines the risk and explains parameter separation, but does not detail attack techniques or testing.
Examples
Shows a Database class using text(query) and params, alongside a SELECT query for Alice’s haikus.
What you can do after
Apply SQLAlchemy’s text() and params to keep user input separate from SQL structure.

Read how Build Python Web Apps with Streamlit explains SQL injection →

Secure APIs

An SQL injection attack abuses application input handling to manipulate a database query through unsafely handled input.

How it is used
Uses SQL injection to connect API input design with database-query safety, validation, testing, and operational defenses.
How deep it goes
Explains payload effects, data exposure, resource exhaustion, parameter constraints, parameterization, fuzz testing, and WAF limitations.
Examples
Uses product filters, sortBy probing, delayed database responses, and payment-record access to demonstrate injection consequences.
What you can do after
Diagnose injection exposure by testing unconstrained parameters, then apply parameterized queries, enumerations, validation, fuzzing, and layered WAF protection.

Read how Secure APIs explains SQL injection →

.NET in Action, Second Edition

A SQL injection vulnerability is a weakness that allows crafted input to alter or execute unintended SQL statements.

How it is used
Frames a database-boundary threat to check during a web-service security audit.
How deep it goes
Works through an interceptor-based SQL audit and contrasting generated queries, without establishing that every query shape is safe.
Examples
Uses an ID lookup, a malicious-looking title in an IN clause, and an EF Core 8 JSON-parameter query.
What you can do after
Diagnose/debug with it by auditing raw SQL calls and inspecting statements captured in tests before database execution.

Read how .NET in Action, Second Edition explains SQL injection →

100 SQL Server Mistakes and How to Avoid Them

SQL injection is an attack technique that alters application-generated database statements by supplying crafted input that is interpreted as SQL code.

How it is used
Frames SQL injection as a database security responsibility requiring defensive configuration alongside application input validation.
How deep it goes
Explains the attack mechanism, demonstrates authentication bypass, shows enabling conditions, and recommends stored procedures without detailing broader secure coding practice.
Examples
Uses a C# login page, a Users table, normal and injected T-SQL predicates, and a replacement login stored procedure.
What you can do after
Evaluate/understand SQL injection by recognizing altered predicates and favoring stored procedures, coding standards, and strong security posture.

Read how 100 SQL Server Mistakes and How to Avoid Them explains SQL injection →

DuckDB in Action

An SQL injection attack is an attack in which crafted input alters the intended semantics of an SQL statement.

How it is used
Protects user-driven SQL workflows by separating input values from statement text.
How deep it goes
Explains altered query semantics, parameter separation, prepared statements, and execution, but does not develop attack payloads.
Examples
Demonstrates a named GDP parameter in DuckDB and retrieves a single aggregate result through fetchone.
What you can do after
Apply it via DuckDB execute and parameterized queries to reduce SQL injection risk from user input.

Read how DuckDB in Action explains SQL injection →

Fundamentals of Cybersecurity

SQL injection is an attack technique that manipulates an application's database queries through crafted input to execute unintended database operations.

How it is used
Explains SQL injection as an application attack that can expose or manipulate database information.
How deep it goes
Defines the input-handling flaw and works through a query and crafted payload.
Examples
Uses a username query for Alice and the payload ' OR 1=1 -- to show possible exposure of user rows.
What you can do after
Understand how crafted input can change a database query and expose stored information.

Read how Fundamentals of Cybersecurity explains SQL injection →

Grokking Software Architecture

SQL injection is an attack technique that inserts crafted input into an application's SQL statements to alter database operations or access data without authorization.

How it is used
Protects database operations by keeping untrusted input from changing the meaning of SQL queries.
How deep it goes
Explains how input becomes executable SQL and contrasts unsafe concatenation with parameterization, without detailing broader exploit mechanics.
Examples
Uses the Little Bobby Tables attack and a teleprompter analogy to illustrate unsafe input and its safe treatment.
What you can do after
Apply it via parameterized queries that treat user input as data rather than executable SQL.

Read how Grokking Software Architecture explains SQL injection →

Build Financial Software with Generative AI (From Scratch)

SQL injection is a vulnerability in which attacker-controlled input changes the intended structure or behavior of a database query.

How it is used
Prevents uploaded filenames and other input from altering database commands during ACH-file persistence.
How deep it goes
Contrasts unsafe interpolation with parameterized insertion and stops short of detailing attack payloads or database internals.
Examples
Uses an ACH upload endpoint that stores a filename and MD5 hash in the ach_files table.
What you can do after
Apply it via parameterized SQL statements and verify safe upload persistence with endpoint tests.

Read how Build Financial Software with Generative AI (From Scratch) explains SQL injection →

Building Web APIs with ASP.NET Core

SQL injection is a security vulnerability in which untrusted input changes the structure or meaning of a SQL statement.

How it is used
Protects dynamically generated database commands from untrusted values changing SQL execution.
How deep it goes
Compares interpolation, parameters, stored procedures, escaping, and EF Core, but does not detail exploit payloads or database internals.
Examples
Uses a user-notes UPDATE statement, unsafe C# interpolation, parameterized commands, and an EF Core update.
What you can do after
Apply it via SQL parameters or EF Core to keep input values separate from generated SQL commands.

Read how Building Web APIs with ASP.NET Core explains SQL injection →

Cyber Threat Hunting

An attack technique that injects SQL statements into an application’s data-processing input to manipulate database operations.

How it is used
Frames SQL injection as an application attack and a web-log hunting target.
How deep it goes
Defines injection, names major payload styles, and demonstrates log searches, status analysis, and source investigation without covering remediation.
Examples
Uses encoded patient-endpoint requests, SQL payload variants, Flask log queries, status breakdowns, and geographic source-IP summaries.
What you can do after
Diagnose/debug with it by searching access logs, decoding request patterns, grouping response codes, and profiling suspicious source addresses.

Read how Cyber Threat Hunting explains SQL injection →

Grokking Web Application Security

SQL injection is an attack technique that alters a database command by supplying input containing characters or syntax interpreted as SQL.

How it is used
Protects web applications that construct database commands from request input.
How deep it goes
Explains vulnerable construction, authentication bypass, destructive commands, and parameterized mitigation.
Examples
Uses login lookups, a DROP TABLE payload, a comment-based password bypass, and prepared-statement listings.
What you can do after
Apply parameterized statements through a database driver to keep dynamic values separate from SQL commands.

Read how Grokking Web Application Security explains SQL injection →

Also covered in

What to know first

Related concepts

Questions about SQL injection

What is SQL injection?

SQL injection is a security flaw or attack in which untrusted input is interpreted as SQL syntax, altering the intended structure or behavior of a database statement.

Which Manning books explain SQL injection?

Acing the Frontend Interview, Build Python Web Apps with Streamlit, Secure APIs, .NET in Action, Second Edition, 100 SQL Server Mistakes and How to Avoid Them, DuckDB in Action, Fundamentals of Cybersecurity, Grokking Software Architecture and 4 more.

What should I know before learning SQL injection?

Manning books that teach SQL injection usually introduce SQL, authentication, authorization and language model first.

What is SQL injection a kind of?

SQL injection is a kind of injection attack. An injection attack is a security attack in which crafted or untrusted input is interpreted as commands, code, or query structure by a target system.

What is SQL injection also called?

SQL injection is also called SQLi.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.