官方的 MASTR 标志 MASTR 支持这项工作
目录
← 知识库首页

Web 基础

Content Security Policy: limit what a page may execute

A browser-enforced policy can reduce injection exposure, but its actual directives determine the protection.

Web2 foundation · 1 min read

研究文章和参考条目以英语发布。导航提供七种语言。

本文目录
  1. The allowed sources
  2. What it cannot decide
  3. 来源与原始文件

The allowed sources

Content Security Policy lets a site declare restrictions on resources and execution. A script policy can specify trusted sources and use nonces or hashes for intended scripts. Other directives govern objects, frames and additional resource types.

A policy's presence is not enough. Broad allowances can undermine the intended restriction, and report-only mode records potential violations without enforcing the same block. The deployed header is the relevant evidence.

What it cannot decide

CSP does not judge whether an allowed application asks for a harmful approval. If the application's own logic creates a misleading transaction request, the browser can faithfully enforce the policy while the user still authorises the wrong action.

Review the policy beside input handling, dependencies and the signing interface. Test that legitimate functions remain usable, and preserve the exact policy version when documenting a finding. A copied scanner grade alone cannot explain coverage. Continue with audit scope and same-origin policy.

来源与原始文件

相关阅读

MASTR

支持独立研究

这里的调查、原始证据和指南均可免费阅读。自愿捐赠帮助支付研究成本,让 MASTR 能够继续提供工具。

打开钱包