# CVE-2024-47169: Agnai Remote Code Execution via path traversal and file upload

Source: https://junglewise.ai/threats/cve-2024-47169-agnai-remote-code-execution-via-path-traversal-and-file-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-47169 · Severity: low · CVSS 3.1 · Published 2024-09-26

Agnai is a character AI roleplay application. An authenticated attacker can upload arbitrary JavaScript files to arbitrary server locations by exploiting insufficient validation of file upload parameters and directory paths, leading to remote code execution and complete server compromise. This affects publicly hosted installations that 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-47169 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-47169 being exploited in the wild.

**How severe is CVE-2024-47169?** 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-47169?** 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-47169 attacked?** It is attacked over the network, in a web application.

**Am I affected by CVE-2024-47169?** 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 combines path traversal (CWE-35) and unrestricted file upload (CWE-434). In the POST /api/chat/{chatId}/temp-character endpoint, the _id parameter is not validated and is directly used to construct file paths. Combined with the entityUploadBase64 function that does not sanitize filenames or validate file types, an authenticated attacker can upload base64-encoded JavaScript files to arbitrary locations (e.g., /../../../../../../app/srv/api/voice). When the application or Node.js process loads these files, the malicious JavaScript executes with server privileges. The attack requires prior authentication but no additional user interaction. Patch version 1.0.330 and later address this vulnerability.

## Affected products

- Agnaistic Agnai before 1.0.330

## Identifiers

- CVE-2024-47169
- GHSA-mpch-89gm-hm83

## Timeline

- 2024-09-26: disclosed
- 2024-09-26: patched: Version 1.0.330 and later

## References

- [https://github.com/agnaistic/agnai/security/advisories/GHSA-mpch-89gm-hm83](https://github.com/agnaistic/agnai/security/advisories/GHSA-mpch-89gm-hm83)

## Related threats

- [Agnai relative path traversal in image upload](https://junglewise.ai/threats/cve-2024-47171-agnai-relative-path-traversal-in-image-upload)
- [Agnai path traversal in JSON file handler](https://junglewise.ai/threats/cve-2024-47170-agnai-path-traversal-in-json-file-handler)
