All jobs / Frontend / web developer / Security

Frontend / web developer interview question · 1–3 years

Marketing wants to render a CMS HTML snippet in React. Strongest answer?

The strongest answer

Don't put untrusted HTML through dangerouslySetInnerHTML — sanitize with a maintained library or store structured fields

Why it works

XSS is a browser issue you own. Prefer structured content; if HTML is required, sanitize on a known-good allowlist.

What a good answer covers

Answers that fall short

Who gets asked this

More Security questions