Hostile input and injection ideas
Software must treat what people type as data, never as instructions. Test with harmless odd input, check it is shown as plain text, and work only inside written permission.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a clerk who follows instructions in the name field. A form is meant to hold a name. Someone writes instructions in the name box. The clerk reads the box and does what it says. The clerk should have filed the words as a name.
Daily List is a to-do list app. Tom, the tester, enters a task title that has angle brackets in it. He checks that the title is shown as plain text and is not run as page code.
Injection means sending input that the software wrongly runs as instructions. means turning special characters into safe text before showing them. is the set of systems you have written permission to test.
The picture has a limit. A clerk is one person. Software has many readers of the same input: the page, the database, the email and the export.
Test only inside , on the Daily List test site.
(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)
PLAIN WORDS · 1 in this section
- encoding
- writing a meaning down as set characters or codes
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Making sure what people type is treated as data, shown as plain text, and tested only inside .
- Keep data apart
- Encode on the way out
- Stay in scope
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| Instructions written in the name box | Hostile input |
| A clerk who follows them | Software that runs input as instructions |
| A clerk who files the words as a name | Software that keeps data and commands apart |
| A permit to enter one office | Authorised scope |
WHERE THIS PICTURE STOPS
- A clerk is one person. Software has many readers of the same input.
- A clerk may notice odd words. Software follows its code exactly.
- A permit is a paper you can see. Scope must be written and kept.
HOOK
Data stays data.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If a box takes text from a person, usually store it and show it as plain words, not as instructions to run.
| In the trick | What it stands for |
|---|---|
| Store as words | keep data apart |
| Show as plain text | output encoding |
| Not run | injection means input the software wrongly runs |
A feature is built to run what people type, so it needs its own careful check.
TELL A FRIEND
A clerk should file the words in the name box as a name, and not follow them. Software should treat input as data.
OFTEN MIXED UP WITH Permissions: who can see and do what. The permissions lesson tests what each person may do. This lesson tests what the software does with what people type.
PRACTISE AND KEEP
Sources for this topic — 6 sources
- Market practice
Structured Query Language (SQL) injection prevention cheat sheet (Open Worldwide Application Security Project) ↗ — Open Worldwide Application Security Project (OWASP) · SQL injection prevention cheat sheet: parameterized queries are the main defence because the database can tell code from data; escaping all input is strongly discouraged (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Read complete official repository sheet. Bind values; dynamic SQL structure requires separate safe handling, and object authorisation remains distinct.
- Market practice
Cross site scripting prevention cheat sheet (Open Worldwide Application Security Project) ↗ — Open Worldwide Application Security Project (OWASP) · Cross site scripting prevention cheat sheet: use the framework's output encoding first, and match the encoding to where the data lands (page text, script, address, style) (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Read framework security, context-specific output encoding, sanitisation and safe-sink sections. HTML interpretation alone does not establish script execution; intentionally accepted rich HTML needs appropriate sanitisation.
- Market practice
Open Worldwide Application Security Project cheat sheet series: input validation ↗ — Open Worldwide Application Security Project (OWASP) · Input validation cheat sheet (registry entry): check input on the server and prefer allow-lists
Search excerpt, page not opened: returned by WebSearch on 2026-10-18. The excerpts did not use the phrase as early as possible in the data flow, so this site does not quote it. It is guidance for software in general, not for payments.
V34 review, 6 November 2026: Read complete official repository sheet. Syntax, semantic business rules, server checks and safe handling of legitimate Unicode/punctuation have distinct roles.
- Market practice
Open Worldwide Application Security Project (OWASP) Top 10:2021, introduction ↗ — Open Worldwide Application Security Project (OWASP) · Top 10:2021 introduction: injection is ranked third, with cross-site scripting folded into it (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: 2021 edition. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Structured Query Language (SQL) injection prevention cheat sheet (Open Worldwide Application Security Project) ↗ — Open Worldwide Application Security Project (OWASP) · Opened primary source, 6 November 2026. OWASP SQL Injection Prevention Cheat Sheet, current guidance: Opened primary/parameterized defenses and allow-listed dynamic structure passages. Preparing already-concatenated SQL is not parameter binding. Opened OWASP XSS Prevention contextual output, dangerous-context, sanitization and safe-sink passages: https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html .
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
V34 review, 6 November 2026: Read complete official repository sheet. Bind values; dynamic SQL structure requires separate safe handling, and object authorisation remains distinct.
- Market practice
OWASP Top 10:2025, released current awareness document ↗ — OWASP · Opened primary source, 6 November 2026. OWASP Top 10:2025, released current awareness document: Opened introduction and category list: critical-risk awareness, not frequency ranking of all weaknesses. Injection A05:2025 versus historical A03:2021.
Primary source opened for V11 quality-characteristics review.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.