HN Hall of Fame Weekly email

Don’t try to sanitize input – escape output

benhoyt.com Books & learning Tutorials & guides Security & privacy Candidate
Screenshot of benhoyt.com captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 3 calendar years, with breakout response in 3 of them.

submissions
3
submitters
2
observed span
2020–2024
peak thread · 280 comments
297 pts
latest 20+ return · 2024-07-10
68 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

You should do both. Sanitize your inputs so that it can be safely stored in your data store, and then sanitize your output so it can be safely displayed. We did this at reddit. We had basic SQL sanitization on the way in, and then a full pass on the way back to the user. The advantage this gave us is that when someone discovered a new way to hack our sanitization, all we had to do was update the…

jedberg·297-point thread·

I think a better way to think of this may be in terms of canonicalization. Inside your application, you should decide on a single canonical way to represent data, one which fits the type of processing and expected use of the application. For example, you might decide that all strings should be UTF8, and should be interpreted (and stored) as whatever the user initially wrote. You might decide that any structured data should be parsed and then stored as protobufs…

We were contacted by a bug hunter once stating he has access to our database and asking for a bounty for his finding, he even provided a sample of first 100 users from the users table in the database. After some investigating, I figured out how did he obtain the data. He was one of the first 100 users, he set one of his fields to an xss hunter payload, and slept on it. After two years, a developer had…

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
3

100+ points or 50+ comments

Total points
493

reference only — not used in Hall rules or ranking

Total comments
487

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2020-02-27Don’t try to sanitize input – escape outputFirst breakout · Best threadbenhoyt297280
2022-01-13Don’t try to sanitize input, escape output (2020)maple3142128128
2024-07-10Don’t try to sanitize input, escape output (2020)Latest 20+ point returnbenhoyt6879