Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CSP improvements

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
django, python
領域
security, web-dev

調査の方向性

現在の CSP レスポンスと、issue で指定されているテンプレート pmaweb/templates/donate.html、sponsors.html、404.html から始めてください。Web サイトジェネレーターがヘッダーを設定する方法を追跡し、その後、可能な限り unsafe-inline を使わない、より厳格なポリシーの下で、インライン分析、PayPal フォーム、画像の使用が機能することを確認してください。

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

説明

enhancement hardening
  1. CSP Improvements (for WebSite)

https://www.phpmyadmin.net/ return the following CSP header:
content-security-policy: default-src 'self'; script-src 'self' 'unsafe-inline' https://www.google-analytics.com/; img-src 'self' https://www.google-analytics.com/ https://www.paypalobjects.com/; style-src 'self' 'unsafe-inline'; child-src 'none'; object-src 'none'

2.1) Change Google Analytics loading

The usage of current Google Analytics code require unsafe-inline in script-src

fix: (by applying any of the below, the unsafe-inline can be removed from script-src)
move the inline code into external file
https://stackoverflow.com/questions/30939809/google-analytics-js-and-content-security-policy
or generate a hash for inline script:
https://www.w3.org/TR/2015/CR-CSP2-20150721/#script-src-hash-usage

2.2) Dynamic CSP usage

The https://www.paypalobjects.com/ in img-src is needed only in some pages, such as:

    https://github.com/phpmyadmin/website/blob/master/pmaweb/templates/donate.html#L31
    https://github.com/phpmyadmin/website/blob/master/pmaweb/templates/sponsors.html#L126

2.3) More Strict CSP Policy

The usage of action attribute is used in the below pages (to https://www.paypal.com/)
https://github.com/phpmyadmin/website/blob/92720e9120eee45b6872b535bb0c85c342e7772c/pmaweb/templates/donate.html#L22
https://github.com/phpmyadmin/website/blob/0da92e1c0fb1f00cfe9edad922b52dc22573fb74/pmaweb/templates/sponsors.html#L113
thus use form-action directive to white-list action locations
https://developer.mozilla.org/en/docs/Web/Security/CSP/CSP_policy_directives#form-action

  1. Missing CSP Policy

visiting:
https://www.phpmyadmin.net/fff/
result:

no CSP Policy sent, also the page load javascript from https://linkhelp.clients.google.com/ (need to add to script-src directive)
https://github.com/phpmyadmin/website/blob/master/pmaweb/templates/404.html#L23

主要言語
Python
スター
55
フォーク
103
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

phpmyadmin/website のほかの issue

phpmyadmin/website の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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