# Improper Restriction of Rendered UI Layers or Frames (CWE-1021) The web application does not restrict or incorrectly restricts frame objects or UI layers that belong to another application or domain, which can lead to user confusion about which interface the user is interacting with. - Prevalence: 中 无 Shoulder 规则 - Impact: 高 OWASP Top 10 #1 - Prevention: 查看 MITRE 外部参考 **OWASP:** Broken Access Control (A01:2021-Broken Access Control) - #1 ## Description A web application is expected to place restrictions on whether it is allowed to be rendered within frames, iframes, or objects. Without these restrictions, the application could be embedded in malicious sites that use clickjacking techniques to trick users into performing unintended actions. ## Prevention ## Consequences - 绕过保护机制 - 获取权限 - 修改应用程序数据 ## Mitigations - 将 X-Frame-Options 头设置为 DENY 或 SAMEORIGIN - 使用 Content-Security-Policy 的 frame-ancestors 指令 - 实现 JavaScript frame-busting 代码作为后备方案