V2EX  ›  英汉词典

Script-src

Definition 定义

script-src:内容安全策略(CSP, Content Security Policy)中的一条指令,用来限制网页可以从哪些来源加载或执行 JavaScript 脚本(例如只允许本站、特定 CDN,或只允许带 nonce/hash 的内联脚本),以减少 XSS 等攻击风险。

Pronunciation 发音

/ˈskrɪpt sɔːrs/

Examples 例句

The site uses script-src 'self' to allow scripts only from the same origin.
网站使用 script-src 'self' 来只允许从同源加载脚本。

To reduce XSS risk, we set script-src to allow a trusted CDN and require a nonce for inline scripts.
为降低 XSS 风险,我们设置 script-src 只允许受信任的 CDN,并要求内联脚本使用 nonce。

Etymology 词源

script 来自拉丁语 scriptum(“写下的东西”),引申为“脚本”;src 是 Web 领域常见缩写,源自 source(“来源/源头”),也常见于 HTML 的 src 属性。script-src 作为复合写法,来自 CSP 标准对“脚本来源”的命名方式。

Related Words 相关词

Literary/Notable Works 文献与作品

  • W3C Content Security Policy (CSP) Specification(W3C 标准文档,出现并定义 script-src
  • MDN Web Docs: Content-Security-Policy(Mozilla 开发者文档,讲解 script-src 用法)
  • OWASP Cheat Sheet Series: Content Security Policy(OWASP 安全指南,包含 script-src 的配置建议)
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   907 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 20:55 · PVG 04:55 · LAX 13:55 · JFK 16:55
♥ Do have faith in what you're doing.