Junglewise Threat Intelligence

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

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

Technologies: Agnai. Vendors: npm.

Executive brief

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.

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

Timeline

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

References

Related threats