← All Learning Paths

Input Hardening

Treat input as hostile: validation, encoding, uploads, and injection defense.

technicalintermediate9 nodes12.67h total

Learning path

Treat input as hostile: validation, encoding, uploads, and injection defense.

  1. 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.

    Completion criteria: Record a short walkthrough of "Security Boundaries in Modern Web Applications" with timestamps at "Cross-Site Scripting" and "Cross-Site Request Forgery", plus the commit that applies it.

    Next step: Add a Content Security Policy with Nonces

    ⏱ 1h

  2. 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

    Completion criteria: Run the steps through "Add a Content-Security-Policy header that reduces XSS impact while allowing the", paste the command output, and mark the line that matches "Each response has a unique nonce available to templates."; then rerun with one parameter changed.

    Next step: How to Handle File Uploads in FastAPI

    ⏱ 0.5h

  3. 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

    Completion criteria: Attach a one-page summary that quotes "Install the multipart dependency and set limits", lists two trade-offs, and links the commit where you applied it.

    Next step: Multer

    ⏱ 1h

  4. 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

    Completion criteria: Attach one successful call and one invalid call against "Multer", citing "upload.single upload.single(fieldname: string): RequestHandler" as the documented surface.

    Next step: express-validator

    ⏱ 1h

  5. 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

    Completion criteria: Run a request against "express-validator", paste the response, and add one deliberately invalid call with its error.

    Next step: Zod

    ⏱ 1h

  6. 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

    Completion criteria: Attach one successful call and one invalid call against "Zod", citing "z.object z.object(shape: ZodRawShape, params?: ZodObjectParams): ZodObject" as the documented surface.

    Next step: HTML Entity Encoder / Decoder

    ⏱ 1h

  7. Run two different inputs through "HTML Entity Encoder / Decoder" and show where the outputs diverge.

    Prerequisites: Zod

    Completion criteria: Run two inputs through "HTML Entity Encoder / Decoder", record both outputs, and show one case where "text to text" changes as expected.

    Next step: Validate a Payload Against a Field Schema

    ⏱ 0.25h

  8. 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.

    Completion criteria: Show the test run for "Validate a Payload Against a Field Schema" with two passing samples and one deliberately failing input, with the expected error.

    Next step: Capstone: Input Hardening

    ⏱ 0.42h

  9. 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

    Completion criteria: Deliver "Rule loader" and paste the test output where the acceptance test passes; include the test name and command.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h