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.
Keep reading
Related articles from the SudoSecurity blog.
Building a Production REST API With Node.js and Express
Build a REST API in Node.js and Express the way production systems need: input validation, JWT auth, refresh token rotation, status codes, rate limiting, idempotency keys, and centralized error handling.
RSA in JavaScript Part 2: The JWT Is Where You'll Actually Meet It
Most JavaScript developers never call an RSA function directly. They verify an RS256 token, and two classic attacks turn that into an authentication bypass — both demonstrated here, both fixed by one line.
RSA Signatures: The Version in Most Tutorials Is Forgeable
Signing is encryption with the keys swapped, and that symmetry is exactly what makes the naive implementation breakable. Here are two forgeries executed against textbook RSA signatures, and what PSS does that hashing alone cannot.
Ask Java for AES and You Get ECB. Nobody Warns You.
Cipher.getInstance("AES") compiles, runs, encrypts, decrypts, and hands you the weakest mode in the box. Here is the OpenJDK source that makes that decision, and the line where ECB gets chosen for you.
Reviews
Enrolled members can rate this course.
No reviews yet.
Untrusted Input
Find every trust boundary, then stop injection and XSS at the source.
- 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
- 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
- 03Output encoding and XSS: render data, never markupContext-aware escaping, real sanitizers for rich text, and nonce-based CSP as the second wall.20mMembers
- 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
- 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
- 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.
- 01Passwords and sessions done rightArgon2id storage, rate-limited logins, session rotation and the cookie flags that matter.18mMembers
- 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
- 03JWT and bearer tokens: signed, not encrypted, not magicalg confusion, kid path traversal, claim checks nobody runs, and where tokens can actually live.20mOpen
- 04Authorization: check the object, not just the loginIDOR, mass assignment, deny-by-default, and pushing access rules down to the database with RLS.18mMembers
- 05The crypto mistakes that keep shippingPredictable randomness, unauthenticated encryption, nonce reuse, timing leaks and what to use instead.20mMembers
- 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.
- 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
- 02Path traversal and file uploadsResolve-then-check containment, random storage names, and validating files by their bytes.18mPremium
- 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
- 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.
- 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
- 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
- 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