# CVE-2024-57186: Erxes path traversal vulnerability in file read endpoint

Source: https://junglewise.ai/threats/cve-2024-57186-erxes-path-traversal-vulnerability-in-file-read-endpoint  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-06-10. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2024-57186 · Severity: medium · CVSS 4 · Published 2025-06-10

Erxes is an open-source customer engagement platform that handles file uploads and retrieval. An unauthenticated attacker can exploit a path traversal flaw in the /read-file endpoint to read any file from the server, potentially exposing sensitive system files, configuration data, and private customer information without any authentication.

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

## Quick answers

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

**How severe is CVE-2024-57186?** Medium severity, with a CVSS score of 4, published 10 June 2025.

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

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

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

**Am I affected by CVE-2024-57186?** Check whether you run erxes (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

- erxes (npm): upgrade to 1.6.2 or later

  ```sh
  npm install erxes@1.6.2
  ```


## Technical details

This is a classic path traversal vulnerability (CWE-22) in the /read-file HTTP endpoint handler. The vulnerability exists because the endpoint fails to properly sanitize or validate user-supplied file path input before processing it, allowing attackers to use directory traversal sequences (e.g., "../../../") to escape the intended directory and access arbitrary files on the system. The flaw is reachable over the network without authentication, making it trivial to exploit. An attacker can read system files like /etc/passwd, configuration files with credentials, private keys, or any other readable file accessible by the application process. The fix, deployed in version 1.6.2, adds filename sanitization using a sanitizeFilename utility function.

## Affected products

- Erxes Erxes <1.6.2

## Identifiers

- CVE-2024-57186
- GHSA-rq9r-qvwg-829q

## Timeline

- 2025-06-10: disclosed
- 2025-06-10: patched: Fixed in version 1.6.2

## References

- [https://github.com/erxes/erxes/commit/d626070a0fcd435ae29e689aca051ccfb440c2f3](https://github.com/erxes/erxes/commit/d626070a0fcd435ae29e689aca051ccfb440c2f3)

## Related threats

- [Erxes authentication bypass in GraphQL via User header](https://junglewise.ai/threats/cve-2024-57190-erxes-authentication-bypass-in-graphql-via-user-header)
- [Erxes path traversal in importHistoriesCreate GraphQL mutation](https://junglewise.ai/threats/cve-2024-57189-erxes-path-traversal-in-importhistoriescreate-graphql-mutation)
- [Erxes cross-site scripting](https://junglewise.ai/threats/cve-2021-32853-erxes-cross-site-scripting)
