Skip to main content

Teaching plan: account-recovery design

Fit and objectives​

Use this lesson in introductory secure software design, web application security or threat-modeling classes. It is a focused OWASP A06:2025 example. No previous Classroom exercise or server-programming experience is required; supplied helpers keep the code repair small.

Students should be able to identify the missing proof-of-control requirement, describe a safe sequence before writing code, connect server-side verification, and distinguish successful normal behavior from security against misuse.

The starter implements a deliberately inadequate requirement: “If an account exists, allow its password to be replaced.” The lesson is not merely about finding a typo in an already secure design. Ask students to replace that requirement and identify rejected transitions before showing the code repair.

Preparation​

  • Use Node 22+, a desktop browser and a plain-text editor. No packages, database or real email are needed after downloading the materials.
  • Export a student kit using the exercise README, then run that kit and the worked solution on classroom hardware. Keep the starter separate from the solution.
  • Review the walkthrough, rubric and worked solution.
  • Set the evidence format, deadline, collaboration policy and use of public solutions. Accept copied outputs instead of screenshots when appropriate.
  • Use fictional credentials only. Explain that the teaching mailbox is a stand-in for an owner's private channel, not access control implemented by the demo.

Suggested 75–90 minutes after setup​

MinutesActivity
0–5Start the local app, identify fictional accounts and save the submission template.
5–15Demonstrate the empty-token reset and test old/new passwords.
15–30Define identifier, proof, token and trust boundary; write the revised design requirement.
30–45Connect the supplied helper in the policy file; explain the guard and update order.
45–55Restart and verify rejected attempts leave credentials unchanged.
55–70Switch to owner role, recover with a fresh token and test replay rejection.
70–90Run automated checks, interpret their boundaries and submit.

Instructional emphasis​

Ask “What does this request prove?” The server must validate a token before changing the password. Checking only that an email exists, hiding a control, or trusting a browser field is not proof of ownership. Token generation and validation are supplied rather than left for beginners to invent.

Keep requester and owner roles explicit. For unauthorized attempts, the learner does not inspect the mailbox. For legitimate recovery, the learner switches to the owner and reads the teaching mailbox. This is a classroom representation of a private channel; it does not claim that two roles displayed in one browser are isolated identities.

Expiry is tested with an injected clock so students do not have to wait ten minutes. A successful test is evidence for a bounded property, not a full authentication audit. The session-invalidation topic belongs to the planned authentication lesson.

Accessibility and fallback​

Use visible labels, keyboard-accessible controls and text results. Allow paired work or an instructor demonstration when Node cannot be installed. For observation-only work, assess the design and evidence interpretation separately from implemented code; do not imply the student executed a repair they only observed.

Further discussion​

Discuss email-channel compromise, token secrecy, rate limiting and abuse prevention, generic response timing, notifications after recovery, MFA and session invalidation. These are not extra graded implementation requirements. See OWASP recovery guidance and Insecure Design.

Screenshot preview