CSP violations on login page blocking inline scripts and font loading (17 errors)
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
调研方向
从 https://hackmd.io/login 开始,打开浏览器 DevTools Console,并检查 response CSP header 以及被阻止的 script 和 font 请求。找出生成该 header 的 configuration,并将其与 issue 中列出的 resources 对照;当登录页面加载时不再出现报告中的 CSP violations,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Is this a hackmd.io issue?
- Yes, the bug happens on https://hackmd.io
What's the problem
Current behaviour
Opening the HackMD sign-in page triggers 17 Content Security Policy (CSP) errors in the browser console:
script-srcdirective blocks inline script execution and scripts from multiple external domains (YouTube, Google, Stripe, Sentry, Plausible, Tally, etc.)font-srcdirective blocks font loading from several URLs (16 occurrences)
The CSP header appears to be missing required domains in its whitelist, and lacks proper nonce or 'unsafe-inline' configuration for inline scripts.
Screenshot:
Steps to reproduce:
- Go to https://hackmd.io/login
- Open browser DevTools → Console tab
- Observe 17 CSP violation errors
Expected behaviour
The login page should load without CSP violations. All required external scripts (Google sign-in, Stripe, Sentry, analytics, etc.) and fonts should be whitelisted in the CSP header.
Environment
Desktop
- OS: iOS, win 11
- Browser: chrome, chrome
- Browser Version: Version 146.0.7680.75 (Official Build) (64-bit)
Additional context
The blocked domains include: youtube.com, gist.github.com, slideshare.net, vimeo.com, google.com, stripe.com, sentry-cdn.com, plausible.io, tally.so, among others. This suggests the CSP script-src directive needs updating to match the scripts actually loaded by the page.
- 主要语言
- 没有语言数据
- 星标
- 40
- 派生
- 9
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hackmdio/hackmd-io-issues 的其他 Issue
-
bug
难度 1/5 1-3 小时 新手友好度 62/100
hackmdio/hackmd-io-issues#121 ·
-
难度 4/5 3-5 天 新手友好度 25/100
hackmdio/hackmd-io-issues#448 ·
-
难度 4/5 3-5 天 新手友好度 15/100
hackmdio/hackmd-io-issues#447 ·
-
难度 4/5 3-5 天 新手友好度 45/100
hackmdio/hackmd-io-issues#446 ·
-
难度 4/5 3-5 天 新手友好度 22/100
hackmdio/hackmd-io-issues#445 · 3 条评论 ·
查看 hackmdio/hackmd-io-issues 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
OpenPrinting/cups#1833 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
phishdestroy/destroylist#476 ·
-
难度 1/5 1 小时以内 新手友好度 94/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
-
curl importer keeps only the first fixed version (166 missing across 66 advisories)可能已有人在做 @Jean-Regis-M 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
aboutcode-org/vulnerablecode#2546 ·
维护者通常 5 天内回复