# CVE-2024-57189: Erxes path traversal in importHistoriesCreate GraphQL mutation

Source: https://junglewise.ai/threats/cve-2024-57189-erxes-path-traversal-in-importhistoriescreate-graphql-mutation  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-06-10. Updated: 2026-05-14  
License: CC BY 4.0 with a link back

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

Erxes is an open-source business operating system used to manage marketing, sales, and customer support. A security flaw in the platform allows a logged-in user to bypass folder restrictions and write files to unauthorized locations on the server. This could allow an attacker to corrupt system files or potentially disrupt business operations.

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

## Quick answers

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

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

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

A path traversal vulnerability (CWE-22) exists in Erxes versions prior to 1.6.2. The flaw is located within the 'importHistoriesCreate' GraphQL mutation handler, which fails to properly sanitize file paths provided by the user. An authenticated attacker can exploit this by submitting specially crafted filenames containing traversal sequences (e.g., '../') to write data to arbitrary locations on the host filesystem. This could lead to unauthorized file modification or system instability. The issue was addressed in version 1.6.2 by implementing filename sanitization using the '@erxes/api-utils/src/sanitize-filename' utility.

## Affected products

- erxes erxes < 1.6.2

## Identifiers

- CVE-2024-57189
- GHSA-2977-5php-6789

## Timeline

- 2024-02-20: patched: Fix committed to repository
- 2025-06-10: disclosed: Vulnerability published via GHSA and NVD

## References

- [https://github.com/erxes/erxes/commit/d626070a0fcd435ae29e689aca051ccfb440c2f3](https://github.com/erxes/erxes/commit/d626070a0fcd435ae29e689aca051ccfb440c2f3)
- [https://github.com/erxes/erxes](https://github.com/erxes/erxes)
- [https://www.sonarsource.com/blog/micro-services-major-headaches-detecting-vulnerabilities-in-erxes-microservices](https://www.sonarsource.com/blog/micro-services-major-headaches-detecting-vulnerabilities-in-erxes-microservices)

## Related threats

- [Erxes path traversal vulnerability in file read endpoint](https://junglewise.ai/threats/cve-2024-57186-erxes-path-traversal-vulnerability-in-file-read-endpoint)
- [Erxes authentication bypass in GraphQL via User header](https://junglewise.ai/threats/cve-2024-57190-erxes-authentication-bypass-in-graphql-via-user-header)
- [Erxes cross-site scripting](https://junglewise.ai/threats/cve-2021-32853-erxes-cross-site-scripting)
