# CVE-2024-47170: Agnai path traversal in JSON file handler

Source: https://junglewise.ai/threats/cve-2024-47170-agnai-path-traversal-in-json-file-handler  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-09-26. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2024-47170 · Severity: low · CVSS 3.1 · Published 2024-09-26

Agnai is an open-source conversational AI application that supports local JSON file storage. A path traversal vulnerability allows authenticated attackers to read arbitrary JSON files from the server, potentially exposing sensitive configuration data, credentials, and application secrets. This affects only deployments with JSON_STORAGE enabled, which is intended for local self-hosting scenarios.

Technologies: [agnai (npm)](https://junglewise.ai/threats/technologies/agnai). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2024-47170 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-47170 being exploited in the wild.

**How severe is CVE-2024-47170?** Low severity, with a CVSS score of 3.1, published 26 September 2024.

**Which products and versions are affected?** agnai (npm) SEMVER:introduced=0,fixed=1.0.330.

**Is there a fix for CVE-2024-47170?** Yes. agnai (npm): upgrade to 1.0.330 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-47170 attacked?** It is attacked over the network.

**Am I affected by CVE-2024-47170?** Check whether you run agnai (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- agnai (npm): upgrade to 1.0.330 or later

  ```sh
  npm install agnai@1.0.330
  ```


## Technical details

The vulnerability is a path traversal (CWE-22/CWE-35) in the loadMessages handler (agnai/srv/api/json/index.ts line 77). An attacker can craft a malicious request using URL-encoded directory traversal sequences (e.g., %2e%2e%2f) in the message ID parameter to escape the intended directory and read arbitrary JSON files. The vulnerable code constructs the file path using unvalidated string interpolation without sanitizing or validating path components. Exploitation requires authentication (PR:L), network access (AV:N), and JSON_STORAGE to be enabled. The impact is limited to confidentiality (C:L); no data modification or service disruption is possible. Patches are available in version 1.0.330 and later.

## Affected products

- Agnai Agnai < 1.0.330

## Identifiers

- CVE-2024-47170
- GHSA-h355-hm5h-cm8h

## Timeline

- 2024-09-26: disclosed
- 2024-09-26: patched: Fixed in version 1.0.330

## References

- [https://github.com/agnaistic/agnai/security/advisories/GHSA-h355-hm5h-cm8h](https://github.com/agnaistic/agnai/security/advisories/GHSA-h355-hm5h-cm8h)

## Related threats

- [Agnai relative path traversal in image upload](https://junglewise.ai/threats/cve-2024-47171-agnai-relative-path-traversal-in-image-upload)
- [Agnai Remote Code Execution via path traversal and file upload](https://junglewise.ai/threats/cve-2024-47169-agnai-remote-code-execution-via-path-traversal-and-file-upload)
