All jobs / Frontend / web developer / Security

Frontend / web developer interview question · 3–5 years

You need a small inline boot script but CSP forbids unsafe-inline. What do you do?

The strongest answer

Give that script a nonce or hash; keep unsafe-inline and eval off; load analytics only after consent

Why it works

CSP is doing its job. Nonce- or hash-based allowlists are the supported door.

What a good answer covers

Answers that fall short

Who gets asked this

More Security questions