CSP violations on login page blocking inline scripts and font loading (17 errors)

オープン
#430 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞

調査の方向性

https://hackmd.io/login から開始し、ブラウザの DevTools Console を開いて、ブロックされたスクリプトおよびフォントのリクエストと併せてレスポンスの CSP ヘッダーを調べます。そのヘッダーを生成している設定を特定し、issue に記載されているリソースと突き合わせます。ログインページが報告された CSP 違反なしで読み込まれれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Is this a hackmd.io issue?
What's the problem
Current behaviour

Opening the HackMD sign-in page triggers 17 Content Security Policy (CSP) errors in the browser console:

  1. script-src directive blocks inline script execution and scripts from multiple external domains (YouTube, Google, Stripe, Sentry, Plausible, Tally, etc.)
  2. font-src directive 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:

Image

Steps to reproduce:

  1. Go to https://hackmd.io/login
  2. Open browser DevTools → Console tab
  3. 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hackmdio/hackmd-io-issues のほかの issue

hackmdio/hackmd-io-issues の issue をすべて見る

似ている issue

Security の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。