Skip to content
Security·Advanced·Conceptual·1 min read

What is DOM clobbering?

Short interview answer

Named HTML elements can create or shadow properties on document and other host objects, causing code to read attacker-created elements instead of expected values. Avoid implicit named access, query explicitly, validate types, and keep unsafe HTML out of the document.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Frontend security basics

Related questions