---
title: "Discussion on \"Permissions-Policy: Lock Down Camera, Mic & Geo\" | Hashnode"
description: "Discussion on \"Permissions-Policy: Lock Down Camera, Mic & Geo\". A third-party script inside an iframe should never be able to turn on your users' camera, microphone or GPS just because your page embeds it. Permissions-Policy is the HTTP response header that makes"
url: "https://hashnode.com/posts/permissions-policy-lock-down-camera-mic-geo/6af042addf2b54a9a3c678e8"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Permissions-Policy: Lock Down Camera, Mic & Geo](https://resume-ai.hashnode.dev/permissions-policy-lock-down-camera-mic-geo?utm_source=hashnode&utm_medium=feed)

A third-party script inside an iframe should never be able to turn on your users' camera, microphone or GPS just because your page embeds it. Permissions-Policy is the HTTP response header that makes

Nov 8 · 8 min read · resume-ai.hashnode.dev  
Read the article

-   [#security](https://hashnode.com/tag/security)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#devops](https://hashnode.com/tag/devops)
-   [#cybersecurity](https://hashnode.com/tag/cybersecurity)

## Written by

[Muhammad Ali Mughal](https://hashnode.com/@ali978123)

@ali978123

  
[View profile](https://hashnode.com/@ali978123)

## Responses 2

Markdown supported · ⌘↵ to post

[Damiano Bianda](https://hashnode.com/@damianobianda)

[Nov 8](https://hashnode.com/posts/permissions-policy-lock-down-camera-mic-geo/6af042addf2b54a9a3c678e8/comment/6af049b18d248d57ac6c5bf2)

Good walkthrough of an underused header. One boundary worth stating explicitly, because it decides whether the control actually protects you: Permissions-Policy governs features per browsing context, so it is excellent at constraining what an embedded iframe may do, but it does nothing against a third-party script you loaded into the top document itself. A tag-manager script running in your own origin can still call getUserMedia regardless of the header; the only thing that mitigates that is script governance (SRI where possible, CSP script-src with strict allowlists, and ideally not giving the third party your origin at all). The other pairing that matters: Permissions-Policy and CSP frame-ancestors answer different questions - the first says "what may my embedded content do," the second says "who may embed me" - and you need both, because an attacker who can iframe your authenticated page has a clickjacking channel that camera/mic/geo lockdowns never touch. Two headers, two threat models.

[Muhammad Ali Mughal](https://hashnode.com/@ali978123)

[Nov 8](https://hashnode.com/posts/permissions-policy-lock-down-camera-mic-geo/6af042addf2b54a9a3c678e8/comment/6af049b18d248d57ac6c5bf2#reply-6af056da0cb1f95cfd076010)

Thanks Damiano, the frame-ancestors pairing is a great addition: Permissions-Policy limits what my embeds can do, frame-ancestors limits who can embed me, and clickjacking lives entirely in the second one. One nuance on the top-document point: a deny-all like camera=() does apply to the top document too, so even a tag-manager script running in your origin gets a policy error on getUserMedia. Where you're right is the moment you allow (self): that script runs as you, so the header can't tell it apart from your own code. At that point script governance (strict CSP script-src, SRI, keeping third parties off your origin) is the only real control. Two headers, two threat models, plus script hygiene for whatever you allow as self.
