Input Hardening
Treat input as hostile: validation, encoding, uploads, and injection defense.
Learning path
Treat input as hostile: validation, encoding, uploads, and injection defense.
Compare "Cross-Site Scripting" with "Cross-Site Request Forgery" in "Security Boundaries in Modern Web Applications" and state which trade-off you would accept in input hardening code.
Next step: Add a Content Security Policy with Nonces
⏱ 1h
Execute "Add a Content Security Policy with Nonces" end to end, then repeat the last step with one parameter changed and compare "Add a Content-Security-Policy header that reduces XSS impact while allowing the".
Prerequisites: Security Boundaries in Modern Web Applications
Next step: How to Handle File Uploads in FastAPI
⏱ 0.5h
Read "How to Handle File Uploads in FastAPI" for the "Install the multipart dependency and set limits" argument, then name the decision in input hardening work it would change.
Prerequisites: Add a Content Security Policy with Nonces
Next step: Multer
⏱ 1h
Read "Multer"'s documented surface around "upload.single upload.single(fieldname: string): RequestHandler", then build a minimal endpoint and log the response.
Prerequisites: How to Handle File Uploads in FastAPI
Next step: express-validator
⏱ 1h
Stand up "express-validator" for a input hardening task, confirm "body body(field?: string, message?: string): ValidationChain" holds, and document one failure you triggered.
Prerequisites: Multer
Next step: Zod
⏱ 1h
- 6
Zod
Wire "Zod" into a scratch input hardening project, following "z.array z.array(element: ZodType): ZodArray", and record one working request/response pair.
Prerequisites: express-validator
Next step: HTML Entity Encoder / Decoder
⏱ 1h
Run two different inputs through "HTML Entity Encoder / Decoder" and show where the outputs diverge.
Prerequisites: Zod
Next step: Validate a Payload Against a Field Schema
⏱ 0.25h
In the "Input Hardening" path, implement "Validate a Payload Against a Field Schema" so JSON object: { schema: { required: string[], types: { [field]: yields [age:expected-number,email:required], including the second sample's edge case.
Next step: Capstone: Input Hardening
⏱ 0.42h
Ship "Rule loader" from "Build a WAF Rule Engine", then prove it with the project's test suite and an acceptance note.
Prerequisites: Validate a Payload Against a Field Schema
Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.
⏱ 4h