Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · Security · Think Like an Attacker · about 14 min to read

Play it as a journeyTutor comes with a plan

The other injections: command, XXE, traversal and races

Web Vulnerabilities
Web Vulnerabilities · Open board

The web bugs where text from outside is treated as something more than text. This lesson adds five more places where that happens, all of them quiet and all of them still found in real servers.

On 4 October 2021 the Apache project released version 2.4.50 of its web server. It fixed one bug, tracked as CVE-2021-41773, in a change made to how the server cleans up file paths. The bug let a stranger ask for a file outside the folders the owner had chosen to publish. Three days later, on 7 October, Apache released 2.4.51, because the fix in 2.4.50 had not covered every way of writing the same attack. Only versions 2.4.49 and 2.4.50 were affected, and Apache said the issue was being used against real servers.

One small piece of path-cleaning code, changed once, put files at risk on servers all over the world. By the end of this lesson you will be able to spot five more bugs of this family in code, and fix each one with a short, specific change.

Before you start. Web Vulnerabilities (the OWASP classics) showed text becoming a database query or a page. Application Hardening gave the rule to check what knocks, and said to check the value in the form that will be used. Review the fix (secure code review) had you review handlers that took a path or a redirect they should not have. The door you forgot was a door (fail-open checks and logic bugs) showed a race, where two requests both pass a check before either acts. This lesson names five more members of the family, and shows each one working before it gives it a name.

Lesson 23 of 39 in Security

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • A command line built from a string: command injection
  • A file name that climbs out: path traversal
  • A document that reads a file for you: XXE
  • A link that sends you elsewhere: open redirect
  • A gap between the check and the use: TOCTOU
  • What all five share
  • 1. Command injection
  • 2. Path traversal
  • 3. XML entities
  • 4. Open redirect
  • 5. TOCTOU
  • Edge cases and trade-offs

Terms it explains: shell, command injection, path traversal, entities, billion laughs, XXE, open redirect, symbolic link, TOCTOU, Common mistakes, cloud metadata endpoint, confused deputy, CSP, CSRF, injection, output encoding, OWASP Top 10, parameterized query / prepared statement, sanitization, SQL injection, SSRF, the universal cure, XSS.

Review Security