The Mistakes Behind Most Breaches
Follow It From the Field to the Place It Runs
Last timeAsking for Somebody Else's Record
Somebody typed something into a box. Trace it, hop by hop, to a place that interprets it, in a browser or on your own server, and then close that path properly.
The places that interpret
The first lesson gave the cause. This lesson is the exercise, because
nobody fixes this class from the principle alone. You fix it by following
a particular field, in a particular system, to a particular place that
interprets it.
So it helps to know the destinations in advance. In a page: text
assembled into markup and inserted into the document, the contents of an
event handler attribute, the target of a script or image, the body of a
style. On your own server, which people forget entirely: a template
compiled from supplied text, a serialised object turned back into an
object, a path that reaches a shell, and any evaluator your language
offers.
Tracing one field through
The procedure is mechanical and it is worth doing by hand once, on your
own system, before automating anything.
field: the display name on a profile
filled in by: anybody with an account
hop 1 the form submits it
hop 2 the server stores it unchanged
hop 3 the profile page reads it
destination: set as the text of a node
verdict: displayed
hop 4 the member list reads it
destination: assembled into markup
verdict: interpreted, finding
hop 5 a weekly report reads it
destination: a mail template
verdict: interpreted, finding
hop 6 an operator screen reads it
destination: assembled into markup
verdict: interpreted, finding
hop 7 a data export writes it
destination: a file opened elsewhere
verdict: interpreted by the reader, finding
four of seven hops interpret it, and the
one safe hop is the page it was designed forTwo habits make this find things. Start from the field, not from the
page, because a page shows you what it uses and not what uses it. And
follow the value through storage rather than stopping at the first
screen, since the whole difficulty of this class is that the dangerous
consumer is usually the one written later by somebody else.
The lesson stops here
4 more paragraphs to go
You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.
The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.
See the planThe contentsThis is the reading half
Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.
The contents