# CVE-2024-47171: Agnai relative path traversal in image upload

Source: https://junglewise.ai/threats/cve-2024-47171-agnai-relative-path-traversal-in-image-upload  
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-47171 · Severity: low · CVSS 3.1 · Published 2024-09-26

Agnai is an open-source conversational AI platform. A path traversal vulnerability in its image upload feature allows authenticated attackers to write image files to arbitrary locations on the server, potentially overwriting critical system files or enabling website defacement. This affects self-hosted instances that are publicly accessible and do not use S3-compatible storage.

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

## Quick answers

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

**How severe is CVE-2024-47171?** 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-47171?** 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-47171 attacked?** It is attacked over the network.

**Am I affected by CVE-2024-47171?** 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

This is a path traversal vulnerability (CWE-35, CWE-22) in the image upload handler. An attacker can inject path traversal sequences (e.g., encoded `../` segments) into the character ID parameter of a POST request to `/api/character`, which is then unsanitized and interpolated into the filename used by the `entityUpload()` function. The vulnerable code concatenates the attacker-controlled ID directly into the filename without path normalization, allowing traversal outside the intended upload directory. Exploitation requires authentication (low privilege) and network access to a public-facing Agnai instance; S3-backed deployments are unaffected. The vulnerability was fixed in version 1.0.330.

## Affected products

- Agnai Agnai < 1.0.330

## Identifiers

- CVE-2024-47171
- GHSA-g54f-66mw-hv66

## Timeline

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

## References

- [https://github.com/agnaistic/agnai/security/advisories/GHSA-g54f-66mw-hv66](https://github.com/agnaistic/agnai/security/advisories/GHSA-g54f-66mw-hv66)

## Related threats

- [Agnai path traversal in JSON file handler](https://junglewise.ai/threats/cve-2024-47170-agnai-path-traversal-in-json-file-handler)
- [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)
