Coder Social home page Coder Social logo

neko7sora / github-learning-lab--security-on-github Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 27 KB

:octocat: Github Learning Lab A robot powered training repository 🤖

Home Page: https://lab.github.com/githubtraining/securing-your-workflows

License: MIT License

CSS 31.79% HTML 11.04% JavaScript 57.17%
github-learning-lab octocat-game octocat learning-lab github-lab

github-learning-lab--security-on-github's Introduction

github-learning-lab--security-on-github's People

Watchers

 avatar

github-learning-lab--security-on-github's Issues

CVE-2020-11023 (Medium) detected in jquery-3.2.1.min.js

CVE-2020-11023 - Medium Severity Vulnerability

Vulnerable Library - jquery-3.2.1.min.js

JavaScript library for DOM operations

Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js

Path to dependency file: Github-Learning-Lab--security-on-github/index.html

Path to vulnerable library: Github-Learning-Lab--security-on-github/index.html

Dependency Hierarchy:

  • jquery-3.2.1.min.js (Vulnerable Library)

Found in HEAD commit: 0210ef12e666d707ab80782a358be3846df65669

Found in base branch: main

Vulnerability Details

In jQuery versions greater than or equal to 1.0.3 and before 3.5.0, passing HTML containing elements from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.

Publish Date: 2020-04-29

URL: CVE-2020-11023

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11023

Release Date: 2020-04-29

Fix Resolution: jquery - 3.5.0


Step up your Open Source Security Game with WhiteSource here

Find repository vulnerabilities

脆弱な依存関係を見つける

セキュリティの脆弱性によって、プロジェクトやそのプロジェクトを使っている人に様々な問題を引き起こします。脆弱性によってプロジェクトの機密性、完全性、可用性が損なわれる可能性があります。あなたのプロジェクトのコード自体には脆弱性がなかったとしても、プロジェクトの依存関係の中に脆弱性があるかもしれないのです。そのため、常に最新のバージョンを使用することが、プロジェクトを安全に保つ上で大切です。

このリポジトリの依存関係には、セキュアに保つためにアップデートが必要なものがいくつかあります。

依存関係を特定し、それらが脆弱かどうかをどうやって把握するか?

このリポジトリはNPMを使ったNode.jsのプロジェクトです。そのため、package.jsonファイルにリポジトリの依存関係が定義されています。今回はこのJavaScriptの依存関係を扱います。他のプログラミング言語では他の依存関係を定義したファイルがあります。実際のプロジェクトでは、GemfileGemfile.lock*.gemspecrequirements.txtpipfile.lockといったファイルを使っているかもしれません。

これらの依存関係が安全であるとどのように確かめるのが良いでしょうか?それは簡単なことではありませんが、GitHubであればこの問題を解決することが出来ます。

脆弱な依存関係に対するGitHubのセキュリティアラート

このリポジトリに対してGitHubから警告が来ている事にお気づきかもしれません。メールで通知を受け取っているかもしれませんし、もしくはpackage.jsonファイルに黄色のバーが表示されているのを見つけたかもしれません。

依存関係の脆弱性アラート

GitHubは公になっているRuby gems、NPM、Python、Java、.NETのパッケージの脆弱性情報を追跡しています。

GitHubは新しく公開された脆弱性の通知を受け取り、その依存関係の脆弱性が含まれているバージョンを使っているリポジトリを探します。そして、その影響のあるリポジトリに関連する方々にセキュリティアラートを送信します。リポジトリのオーナーに対してはデフォルトで通知が送られます。しかし、この重要な通知を他のチームやメンバーが受け取るように設定することも可能です。

GitHubはどのようなリポジトリにおいても、そのリポジトリにおける脆弱性の情報を公開することは致しません。

ステップ2:このリポジトリの脆弱な依存関係を見つけよう

GitHubのセキュリティアラートを使って、脆弱なNPMの依存関係を見つけてみましょう。

⌨️ やってみよう:バージョンアップの提案を見つけよう

  1. リポジトリのInsightsタブをクリック
  2. 画面左のナビゲーションバーからDependency graphをクリック
  3. 黄色くハイライトされたdebugという名前の依存関係までスクロールダウンし、黄色のdebugの右側をクリック
  4. 提示されているバージョンを確認
  5. このイシューに提示されているバージョンをコメントで記載

GitHub Enterprise Serverのみ: GitHub Enterprise ServerではGitHub Connectを使うことで脆弱性アラートを使うことが出来ます。アラートが投げられるまでは1時間ほどかかることがあります。一定時間以上待ってもDependency Graphに黄色のバーが表示されない場合は、管理者に確認してみてください。問題が解決するまでの間、コースを進めるためにヒントを差し上げましょう - 推奨されたアップグレードバージョンは 2.6.9です。

このコースの手順はQuick Reference Guideにもまとまっています。


完了したら、次のコメントをこのイシューに書きます。

Welcome

🎉 安全なワークフローのコースへようこそ!

このコースでは、GitHub上でリポジトリを安全に保つ方法を学ぶことが出来ます。リポジトリを安全に保つことは多くの理由で重要です。

  • 機密データを誤って公開してしまうことを防ぐ
  • 安全な開発のベストプラクティスを必須とする
  • 意図しないアクセス権を付与してしまうことを防ぐ

このコースでは、下記の内容を学びます:

  • プライベートリポジトリでの脆弱性アラートを有効化する
    • 注記:これらのセキュリティの設定はフォークではないパブリックリポジトリではデフォルトで有効化されています。
  • 脆弱性アラートによって通知された脆弱な依存関係を検出し、修正する
  • .gitignoreファイルを使うことで機密データを保護するというベストプラクティスのやり方

GitHubを使うのは初めてですか?

このコースでは、GitHub Flowに事前に習熟している必要があります。GitHub Flowをご存じない方は、Introduction to GitHubコースを御覧ください。

ステップ1:GitHub Pages上のプロジェクト

このコースではGitHub Pagesにデプロイされた記憶ゲームを題材に使用します。

⌨️ やってみよう:GitHub Pagesの有効化

  1. リポジトリのSettingsタブをクリック
  2. GitHub Pagesのセクションまで画面をスクロールし、Sourceとしてmainを選択し、Saveをクリック

このコースの手順はQuick Reference Guideにもまとまっています。

GitHub Pagesを有効化すると、リポジトリの内容をデプロイします。デプロイが完了するまで待つ必要があるので、次のコメントまで1分ほどお待ち下さい。


設定が完了したら、次のコメントをこのイシューに書きます。

時々、追加のコメントが書き込まれないことがあります!正しい操作をしたにも関わらず何のコメントも書き込まれない場合は、数秒待ってからこのペ
ージを再読込してください。

CVE-2020-7774 (High) detected in y18n-4.0.0.tgz - autoclosed

CVE-2020-7774 - High Severity Vulnerability

Vulnerable Library - y18n-4.0.0.tgz

the bare-bones internationalization library used by yargs

Library home page: https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz

Path to dependency file: /tmp/ws-scm/security-on-github/package.json

Path to vulnerable library: /tmp/ws-scm/security-on-github/node_modules/npm/node_modules/y18n/package.json

Dependency Hierarchy:

  • npm-6.14.11.tgz (Root Library)
    • cacache-12.0.3.tgz
      • y18n-4.0.0.tgz (Vulnerable Library)

Found in HEAD commit: 0210ef12e666d707ab80782a358be3846df65669

Found in base branch: main

Vulnerability Details

This affects the package y18n before 3.2.2, 4.0.1 and 5.0.5. PoC by po6ix: const y18n = require('y18n')(); y18n.setLocale('proto'); y18n.updateLocale({polluted: true}); console.log(polluted); // true

Publish Date: 2020-11-17

URL: CVE-2020-7774

CVSS 3 Score Details (7.3)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: Low

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7774

Release Date: 2020-11-17

Fix Resolution: 5.0.5


Step up your Open Source Security Game with WhiteSource here

CVE-2021-23343 (High) detected in path-parse-1.0.6.tgz

CVE-2021-23343 - High Severity Vulnerability

Vulnerable Library - path-parse-1.0.6.tgz

Node.js path.parse() ponyfill

Library home page: https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz

Path to dependency file: Github-Learning-Lab--security-on-github/package.json

Path to vulnerable library: Github-Learning-Lab--security-on-github/node_modules/npm/node_modules/path-parse/package.json

Dependency Hierarchy:

  • npm-7.14.0.tgz (Root Library)
    • libnpmpublish-4.0.1.tgz
      • normalize-package-data-3.0.2.tgz
        • resolve-1.20.0.tgz
          • path-parse-1.0.6.tgz (Vulnerable Library)

Found in HEAD commit: 5442765fd58bf881690bd63767c3084b5b10c20d

Found in base branch: main

Vulnerability Details

All versions of package path-parse are vulnerable to Regular Expression Denial of Service (ReDoS) via splitDeviceRe, splitTailRe, and splitPathRe regular expressions. ReDoS exhibits polynomial worst-case time complexity.

Publish Date: 2021-05-04

URL: CVE-2021-23343

CVSS 3 Score Details (7.5)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: None
    • Scope: Unchanged
  • Impact Metrics:
    • Confidentiality Impact: None
    • Integrity Impact: None
    • Availability Impact: High

For more information on CVSS3 Scores, click here.


Step up your Open Source Security Game with WhiteSource here

CVE-2019-11358 (Medium) detected in jquery-3.2.1.min.js

CVE-2019-11358 - Medium Severity Vulnerability

Vulnerable Library - jquery-3.2.1.min.js

JavaScript library for DOM operations

Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js

Path to dependency file: Github-Learning-Lab--security-on-github/index.html

Path to vulnerable library: Github-Learning-Lab--security-on-github/index.html

Dependency Hierarchy:

  • jquery-3.2.1.min.js (Vulnerable Library)

Found in HEAD commit: 0210ef12e666d707ab80782a358be3846df65669

Found in base branch: main

Vulnerability Details

jQuery before 3.4.0, as used in Drupal, Backdrop CMS, and other products, mishandles jQuery.extend(true, {}, ...) because of Object.prototype pollution. If an unsanitized source object contained an enumerable proto property, it could extend the native Object.prototype.

Publish Date: 2019-04-20

URL: CVE-2019-11358

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11358

Release Date: 2019-04-20

Fix Resolution: 3.4.0


Step up your Open Source Security Game with WhiteSource here

CVE-2020-11022 (Medium) detected in jquery-3.2.1.min.js

CVE-2020-11022 - Medium Severity Vulnerability

Vulnerable Library - jquery-3.2.1.min.js

JavaScript library for DOM operations

Library home page: https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js

Path to dependency file: Github-Learning-Lab--security-on-github/index.html

Path to vulnerable library: Github-Learning-Lab--security-on-github/index.html

Dependency Hierarchy:

  • jquery-3.2.1.min.js (Vulnerable Library)

Found in HEAD commit: 0210ef12e666d707ab80782a358be3846df65669

Found in base branch: main

Vulnerability Details

In jQuery versions greater than or equal to 1.2 and before 3.5.0, passing HTML from untrusted sources - even after sanitizing it - to one of jQuery's DOM manipulation methods (i.e. .html(), .append(), and others) may execute untrusted code. This problem is patched in jQuery 3.5.0.

Publish Date: 2020-04-29

URL: CVE-2020-11022

CVSS 3 Score Details (6.1)

Base Score Metrics:

  • Exploitability Metrics:
    • Attack Vector: Network
    • Attack Complexity: Low
    • Privileges Required: None
    • User Interaction: Required
    • Scope: Changed
  • Impact Metrics:
    • Confidentiality Impact: Low
    • Integrity Impact: Low
    • Availability Impact: None

For more information on CVSS3 Scores, click here.

Suggested Fix

Type: Upgrade version

Origin: https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

Release Date: 2020-04-29

Fix Resolution: jQuery - 3.5.0


Step up your Open Source Security Game with WhiteSource here

Congratulations!

素晴らしいです

celebrate

おめでとう、@Neko7sora、無事にこのコースを完了できました!

リポジトリのセキュリティを考える際には、私のようなインストールするアプリについても考えましょう。リポジトリにインストールされているアプリは何らかのあなたのデータにアクセスすることが出来ます。たとえそれががいのないもの(私のように)であったとしても、定期的にリポジトリのインストール済みアプリや連携をチェックしてリストから余計なものを削除するのは良い考えです。今も使っているものかどうか、必要以上にアクセス権限を渡しているものがないかどうかをチェックしましょう。

アプリの権限の管理

お別れを言うのは悲しいですが、このリポジトリから私をアンインストールしてもらいたいと思います。アンインストールしたあとではおめでとうを伝えることは出来ませんが、あなたが前進しているのを嬉しく思います。

GitHubのドキュメントのガイドラインに従って認可されたOAuthアプリやGitHubアプリのレビューをしましょう。もし試しにやってみたいのであれば、このリポジトリからLearning Labアプリをアンインストールしましょう。

このコースでやったこと

さようならを言う前に、このリポジトリで達成したタスクを振り返ってみましょう:

  • プライベートリポジトリで脆弱な依存関係の検知を有効化
  • セキュリティ脆弱性を持った古い依存関係を検知して修正
  • .gitignoreファイルを使って機密情報ををリポジトリから除外

次のステップ

リポジトリを安全に保つ他の選択肢も学習したいですか?セキュリティアラートのドキュメントセキュリティ関連のGitHubアプリはコードを安全に保つ上で参考になります。

学び続けましょう

学び続けたいですか?他のコースもチェックしてみましょう


私からのコメントは終わりです、完了したらクローズしましょう。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.