Get the App
SLTechnology News&Howtos  ›  Network Security  › 

How to reproduce Ruby on Rails path traversal and arbitrary file reading vulnerability CVE-2019-5418

Shulou Source: shulou.com Published: 2022-05-31 19:32:22 10月03日 Update

This issue of the content of the editor will bring you about how to carry out Ruby on Rails path traversal and arbitrary file reading vulnerability CVE-2019-5418 reproduction, the article is rich in content and professional analysis and description for you, I hope you can get something after reading this article.

Brief introduction of vulnerabilities:

Ruby on Rails is a web application framework and a relatively new web application framework.

Built on Ruby language

Threat Typ

Remote code execution, arbitrary file reading

Threat level

High

Vulnerability number

CVE-2019-5418

Affected system and application version

Full version of Rails

In which the repaired version

6.0.0.beta3

5.2.2.1

5.1.6.2

5.0.7.2

4.2.11.1

Loophole recurrence: 1. Build the environment

Ruby On Rails environment construction

1. Install git

2. Install rbenv to the ~ / .rbenv directory

3. Install the plug in rbenv for compiling and installing ruby

4. It is optional to manage gemset, because there is no need for bundler.

5. After installing gem through the gem command, there is no need to enter the rbenv rehash command manually

Update rbenv and all plug-ins through the rbenv update command

7. Use Ruby China image to install Ruby, which is recommended by domestic users

8. Then you need to put the following two lines of code in the configuration file of bash:

9. Execute the following command to make it effective

Source / .bashrc

10. Install ruby

Execute "rails s" under the demo path to start the service

Specify port 9876

Access the "chybeta" path:

We use the developer tool that comes with the browser to reproduce the vulnerability. Press "f12" to open the tool and modify the request as follows:

The vulnerability was successfully reproduced and the contents of the passwd file were successfully read:

2. Repair it is recommended to use the version that has fixed the vulnerability. The above is how to perform Ruby on Rails path traversal and arbitrary file reading vulnerability CVE-2019-5418 has been reproduced. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Tags: Vulnerabilities files paths content commands versions applications success code tools applications frameworks environments programs analysis threats necessity nothing small and medium rich in content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Tech Info Shulou Technology Redmi OPPO Reno