IFrame 태그의 보안 고려 사항

작성자

카테고리:

← 피드로
DEV Community · Jaisurya · 2026-08-06 개발(SW)

Jaisurya

The (Inline frame) tag is used to embed another HTML document or web resource inside the current webpage. It essentially creates a nested browser window within your layout.</p> <p>There are security risks that can be created by using iframes unless handled in the right manner. As an example, content that uses embedded external websites can create the risk of clickjacking or script injections. To counter these:</p> <ul> <li>Take a sandbox attribute to limit the frame behaviour (block scripts, forms, or popups).</li> <li>Never leave an unverified source dangling as src, or domain, etc.</li> <li>Integrate the sandbox with the ability to allow attributes to have more precise control. </li> </ul> <div class=”highlight”><pre class=”highlight html”><code><span class=”nt”>&lt;iframe</span> <span class=”na”>src=</span><span class=”s”>”https://www.youtube.com”</span> <span class=”na”>sandbox=</span><span class=”s”>”allow-scripts allow-same-origin”</span><span class=”nt”>&gt;&lt;/iframe&gt;</span> </code></pre></div> <p></p>

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다