← All Learning Paths

Secure Coding Engineer

Write code attackers cannot quote: parameterized queries, output encoding, CSRF tokens, deserialization guards, and CSP headers that actually enforce.

roleintermediate5 nodes11h total

Path overview

安全编码的核心动作只有一个:永远不把数据当代码执行。本路径沿注入类漏洞的家族谱系展开——SQL、XSS、命令、路径、反序列化,每类都给出结构性防御,再落地参数化重构与 CSP 配置,收尾于参数化查询练习。

Secure coding has one core move: never treat data as code. This path walks the injection family — SQL, XSS, command, path, deserialization — with structural defenses, CSP, and practice.

  1. Compare "Why concatenation fails" with "Convert the common case" in "How to Refactor to Parameterized Queries" and state which trade-off you would accept in security code.

    Completion criteria: Attach a one-page summary that quotes "Why concatenation fails", lists two trade-offs, and links the commit where you applied 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 "Generate a cryptographically random nonce per response and expose it to the template".

    Prerequisites: How to Refactor to Parameterized Queries

    Completion criteria: Run "Add a Content Security Policy with Nonces" twice — once as written and once with a changed input — and attach both transcripts with the observed difference.

    Next step: Helmet

    ⏱ 0.5h

  3. Wire "Helmet" into a scratch security project, following "contentSecurityPolicy helmet.contentSecurityPolicy({ directives })", and record one working request/response pair.

    Prerequisites: Add a Content Security Policy with Nonces

    Completion criteria: Attach one successful call and one invalid call against "Helmet", citing "contentSecurityPolicy helmet.contentSecurityPolicy({ directives })" as the documented surface.

    Next step: SQL Parameterized Queries

    ⏱ 1h

  4. Implement "SQL Parameterized Queries" so that Safe query results yields safe query, including the edge case in the second sample.

    Prerequisites: Helmet

    Completion criteria: Attach the solution file, two passing sample runs, and one failing run whose error matches the contract for "safe query".

    Next step: Capstone: Secure Coding Engineer

    ⏱ 0.5h

  5. Deliver the "Build an Input Sanitizer Service" blueprint with "Schema validator" working and "HTML stripper" recorded as evidence.

    Prerequisites: SQL Parameterized Queries

    Completion criteria: Run the project's test command for "Build an Input Sanitizer Service", paste the passing output, and attach the acceptance note for "Schema validator" with the test name.

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

    ⏱ 4h