Chuyển đến nội dung
Skillpedia
Bảo mật75k · #2977

permissions-policy

Skill này làm gì

Skill này kiểm tra các header bảo mật mà website gửi đi và thêm header Permissions-Policy để hạn chế các tính năng trình duyệt mạnh. Skill dành cho lập trình viên muốn thêm một lớp bảo vệ cho ứng dụng web.

Khi nào nên dùng

  • ✓Khi bạn yêu cầu agent rà soát các header bảo mật của một website.
  • ✓Khi website không dùng các tính năng như camera hoặc định vị và bạn muốn chúng bị chặn mặc định.
  • ✓Khi bạn đang tăng cường bảo mật ứng dụng web và muốn giảm những gì kẻ tấn công có thể truy cập sau một lần tiêm mã thành công.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/permissions-policy/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/permissions-policy/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể kiểm tra các header bảo mật của website tôi và thêm Permissions-Policy tắt các tính năng tôi không dùng không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra xem header Permissions-Policy đã được gửi chưa và những tính năng mạnh nào đang được cho phép. Sau đó agent thêm một header từ chối các tính năng không dùng, như camera, micro và định vị, và chỉ mở rộng danh sách cho những gì ứng dụng cần.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Set a Permissions-Policy header

A site compromised by XSS that has unrestricted camera and microphone access can silently record the user. Permissions-Policy limits which browser APIs are available, reducing attacker capabilities even after a successful injection.

Quick Reference

  • Use Permissions-Policy to disable browser features your site does not use (camera, microphone, geolocation, payment)
  • Syntax: Permissions-Policy: camera=(), microphone=(), geolocation=() — empty () means denied to all
  • Previously called Feature-Policy — the old syntax is deprecated and only supported in older browsers
  • Restricting unused features limits the blast radius if your site is compromised by XSS
  • Third-party iframes inherit page restrictions unless you explicitly grant them permissions

Check

Check whether the server sends a Permissions-Policy header and review which browser features are allowed or denied. Identify any powerful features (camera, microphone, geolocation, payment, USB) that are enabled but not required by the application.

Fix

Add a Permissions-Policy header that disables all browser features your site does not use. Start with camera=(), microphone=(), geolocation=() and expand the list based on what the application actually needs.

Explain

Explain what the Permissions-Policy header does, how it restricts browser APIs like camera and geolocation, and why disabling unused features improves security.

Code Review

Review server config, headers, forms, and integration points related to Set a Permissions-Policy header. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/permissions-policy

Câu hỏi thường gặp

Cặp ngoặc rỗng nghĩa là gì?

Skill nói cặp ngoặc rỗng như camera=() từ chối tính năng đó với mọi trang web.

Feature-Policy còn được dùng không?

Skill nói đó là tên cũ đã bị ngừng dùng và chỉ được hỗ trợ ở trình duyệt cũ.

Các iframe bên thứ ba có nhận những quyền này không?

Chúng kế thừa các giới hạn của trang trừ khi trang nói rõ ràng cấp quyền.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing HTTP response headers for defense-in-depth security hardening on any web application.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2977
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự