DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
Web Security Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
medium
Web Security
What's the main reason to use a maintained library like DOMPurify instead of hand-rolled sanitization when you genuinely need to allow SOME user HTML (e.g. a rich-text comment)?
A
Hand-rolled code is always faster
B
Hand-rolled sanitization reliably misses edge cases (obscure sinks, encoding tricks) that a security-audited library already accounts for
C
There's no real difference either way
D
DOMPurify removes the need for httpOnly cookies
Check Answer