Skip to content

Course

Secure Coding in Practice

Write code attackers can't bend: map every trust boundary, kill injection with parameters, handle passwords, sessions, CSRF and tokens correctly, dodge the classic crypto mistakes, and shut down SSRF, traversal, SSTI, resource bombs and race conditions — with fixes in Python, JavaScript, PHP and Java.

20 lessons

Course Q&A

Keep reading

Related articles from the SudoSecurity blog.

Reviews

Enrolled members can rate this course.

No reviews yet.

Untrusted Input

Find every trust boundary, then stop injection and XSS at the source.

  1. 01Trust boundaries: every input is hostile until proven otherwiseMap where untrusted data enters — headers, webhooks, stored fields — and apply normalize → allowlist → encode in that order.15mOpen
  2. 02Injection: parameters for SQL, argument arrays for commandsWhy concatenated queries and shell strings get owned, and the typed side channel that fixes every interpreter.20mOpen
  3. 03Output encoding and XSS: render data, never markupContext-aware escaping, real sanitizers for rich text, and nonce-based CSP as the second wall.20mMembers
  4. 04Template injection: when user input becomes program sourceWhy render_template_string('x' + name) is RCE, how {{config}} leaks secrets, and the sandboxed engines that survive user-authored templates.16mOpen
  5. 05Mass assignment and prototype pollutionRequest binders write every key the body carries, and `__proto__` merges write onto Object.prototype — allowlists and merge hygiene are the only fixes.18mOpen
  6. 06Unicode, normalization, and lookalike identifiersIdentifiers compare at the byte level: NFC vs NFD, Turkish-I case folding, bcrypt's 72-byte cutoff, and lookalike glyphs all change what 'equal' means.15mOpen

Identity, Sessions and Secrets

Passwords, cookies, authorization checks and the crypto mistakes that undo them.

  1. 01Passwords and sessions done rightArgon2id storage, rate-limited logins, session rotation and the cookie flags that matter.18mMembers
  2. 02CSRF: the requests your users' browsers make for someone elseWhy CORS doesn't save cookie auth, what SameSite=Lax actually blocks, and the token and header checks that do.16mOpen
  3. 03JWT and bearer tokens: signed, not encrypted, not magicalg confusion, kid path traversal, claim checks nobody runs, and where tokens can actually live.20mOpen
  4. 04Authorization: check the object, not just the loginIDOR, mass assignment, deny-by-default, and pushing access rules down to the database with RLS.18mMembers
  5. 05The crypto mistakes that keep shippingPredictable randomness, unauthenticated encryption, nonce reuse, timing leaks and what to use instead.20mMembers
  6. 06Secrets, logs, and the debug modes that leak themSecrets leak through git history, debug-mode error pages, browser-bundled env vars, logs, and crash reports — rotation and filtering are the fixes.15mOpen

Hostile URLs, Files and Formats

SSRF, path traversal, uploads, deserialization and the dependencies you didn't write.

  1. 01SSRF and URL handling: don't let users aim your serverWhy string checks on URLs fail, the IP tricks attackers use, and a fetch that holds up against 169.254.169.254.20mPremium
  2. 02Path traversal and file uploadsResolve-then-check containment, random storage names, and validating files by their bytes.18mPremium
  3. 03Unsafe deserialization and the code you didn't writeWhy pickle and unserialize are remote code execution, and how to keep the dependency tree honest.20mPremium
  4. 04XXE: the parser reads your filesystemExternal entities turn any XML-ish input — SAML, docx, SVG — into file read plus SSRF, and the disabling flags differ per stack.16mOpen

Abuse and Failure Modes

ReDoS, resource bombs and the races that slip between check and act.

  1. 01Inputs that burn: ReDoS, bombs and rate-limit economicsThe regex that took down Cloudflare, decompression bombs, hash flooding and rate limits that make attacks cost more than they're worth.15mOpen
  2. 02Race conditions: the gap between check and actDouble-spends, limit overruns and symlink swaps — and the atomic writes, locks and constraints that close the gap.16mOpen
  3. 03Business logic: the rules your tests never checkSemantics are the attack surface: client-computed totals, float money, negative quantities, and skipped flow steps all survive syntactic validation.18mOpen

The Proxy in Front

  1. 01X-Forwarded-* and Host: the headers your framework believesProxies rebuild the request's identity from X-Forwarded-For, X-Forwarded-Proto, and Host — trust hop counts and pinned hosts, never the header.16mOpen