Executive brief
Jan is a popular open-source application for local AI model management. An arbitrary file upload vulnerability in the /v1/app/writeFileSync API endpoint allows attackers to upload crafted files without authentication, potentially leading to arbitrary code execution. This vulnerability could allow remote attackers to completely compromise systems running Jan.
Technical details
An unrestricted file upload vulnerability exists in the /v1/app/writeFileSync interface of Jan v0.4.12 and earlier, classified as CWE-434 (Unrestricted Upload of File with Dangerous Type). The vulnerability stems from insufficient path validation in file write operations. Attackers can exploit this via network requests without authentication to upload arbitrary files to sensitive locations on the system, enabling arbitrary code execution. The vulnerability has been patched in janhq/jan v0.5.2; the deprecated @janhq/core library should no longer be used.
Affected products
- Jan Jan 0.4.12 and earlier
- Jan core 0.1.11 and earlier (deprecated)
Timeline
- 2024-06-04: disclosed
- 2024-07-11: patched: Fixed in Jan v0.5.2 via path validation improvements