Executive brief
Jan is an open-source alternative to ChatGPT that runs locally on computers. The application contains a critical vulnerability in its file-reading API that allows attackers to read any file on the system without authentication, potentially exposing sensitive data like configuration files, private keys, and user documents stored on the affected computer.
Technical details
The vulnerability is a path traversal / arbitrary file read issue (CWE-22, CWE-31) in Jan's file handling API. The /v1/app/readFileSync endpoint does not sanitize or validate user-supplied file path parameters, allowing attackers to use relative path traversal sequences (e.g., "/../../../etc/passwd") to escape the intended directory and access any file readable by the Jan process. The endpoint is network-accessible via HTTP POST requests without authentication or privilege requirements. An attacker can read sensitive system files, configuration files, or other data accessible to the Jan process. The vulnerability affects versions up to 0.1.11 of the @janhq/core npm package; patched versions should be available through the Jan project's release channels.
Affected products
- Jan (janhq) @janhq/core 0.1.11 and earlier, including 0.4.12
Timeline
- 2024-06-04: disclosed: GHSA-5jqc-qj57-4hrc published; CVE-2024-36857 assigned
- 2024-06-11: other: GitHub security review completed