← Capture the flag

What your page gives away

A web page is sent whole to every visitor's browser, so its source is theirs to read: comments, hidden fields and scripts, even when the page doesn't show them. Photos can carry where they were taken. And a check that runs in the browser can be skipped. Keep secrets and real checks on the server, and strip photo details before you upload.

The club page looks harmless. View its source and it gives away a password, three emails and a join code.

Your mission: the club's website is about to go live. Check it the way a visitor could, find everything it gives away, and fix it before anyone else looks.

EngageCommit to a prediction before you test anything. A wrong guess is fine: it shows you what to look for.

Engage: not shown, not sent?

A page has a hidden field holding members' emails. It doesn't show on the page. Can a visitor get the emails?

ExploreTry it on the board and compare what happens with your prediction.

Explore: check the club page

Was your prediction right?

Try it yourselfYour edits are saved in this browser.

Find everything the club page gives away. Look at what visitors see, then everything their browser receives. Mark only real leaks.

Use the board. This ticks when you get there.

ExplainPut a name to what you saw, and why it works.

Explain: everything is sent

Worked exampleBefore each step, say what you think comes next.
  1. comments\text{comments}Not shown, but sent: never put passwords or notes in them.

Find the mistake

Sam adds the members' emails to the page. Click the line where it first goes wrong.

ElaborateUse the idea in a new situation.

Elaborate: fix it

Try it yourselfYour edits are saved in this browser.

Fix all four leaks on the club page so nothing private reaches a visitor.

Use the board. This ticks when you get there.

Now check the sign-up page. Mark only real leaks.

Use the board. This ticks when you get there.

ElaborateUse the idea in a new situation.

Elaborate: before launch

Try it yourselfYour edits are saved in this browser.
Need a hint?

For each leak, ask: after this fix, does the visitor's browser still receive it?

Another hint

Renaming, hiding and splitting all leave it in the page.

Fix every leak on the sign-up page before it launches.

Use the board. This ticks when you get there.

EvaluateLook back at your first ideas and what changed.

Evaluate: look back

You're about to post a photo taken at home on the club page. What should you check first?

For teachers

Students view a club web page as a visitor can, through its source and a photo's details, find what it gives away (a password in a comment, emails in a hidden field, a join code in a script, a photo's location), fix each leak, then check and fix a sign-up page (AC9TDI10P14 node 3). Defensive, on the students' own made-up pages. A 5E mission lesson. About 45 minutes.

Open the teacher guide: answers, solutions, slides and a worksheet.

Students will be able to

Before class

Try the boards yourself. The pages, people and addresses are made up.

The one idea: the whole page is sent to every visitor, so anything in it can be read; secrets and real checks belong on the server, and photos should lose their location before upload.

This is about checking your own pages (the students' own sites in HTML & CSS or Your site). Real browsers show the source with View source (Ctrl+U or Cmd+Option+U) and the developer tools.

Simplifications: "the server" stands for any code the visitor doesn't receive. Photo details are EXIF data; many phones add the location unless it is turned off, and some sites remove it on upload, but not all.

Running the lesson

  1. Engage: ask what 'hidden' means on a web page.
  2. Explore: ask which leak was hardest to find, and why.
  3. Explain: run the browser test on each line of the source together.
  4. Elaborate: ask why the unlisted drafts page isn't private.
  5. Evaluate: have students check their own phone's camera location setting.

The hard part (on purpose)

Students pick fixes that hide (white text, rename, move). Keep asking the one question: does the browser still receive it?

When students get stuck

Stretch and support

Stretch: View the source of one of your own pages (from HTML & CSS) and list anything you wouldn't want a visitor to read.

Support: The one question on a card: does the visitor's browser receive it?

Where it leads

Next: Capture the flag, the old archive.

What each step is for

Now you can
Next lesson3. Capture the flag: the old archiveThe club's old archive server is being wiped on Friday. Before it goes, find out what it still gives away: five flags, each found with a skill from Digital systems (decoding, page source, the command line, a tiny processor and a key word). Then close the archive's leaks so the secrets can be changed.