Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-108940 Overview
CVE-2026-108940 is a path traversal vulnerability [CWE-22] in EricLBuehler Mistral.rs through version 0.9.3. The flaw resides in the calibration_apply function within mistralrs-server-core/src/handlers.rs. Attackers can manipulate the save_cimatrix argument to write files outside the server's intended working directory. The attack is network-reachable, requires no authentication, and no user interaction. A public exploit has been disclosed, and the maintainer resolved the issue in version 0.9.4 via commit 8c81056712709b4845ec6d9531e4d35bab4a367c.
Critical Impact
Remote unauthenticated clients can write .cimatrix output to arbitrary filesystem paths accessible to the Mistral.rs server process, enabling file overwrite and integrity impact on the host.
Affected Products
- EricLBuehler Mistral.rs versions up to and including 0.9.3
- Component: mistralrs-server-core (server HTTP handlers)
- Fixed release: Mistral.rs v0.9.4
Discovery Timeline
- 2026-10-13 - CVE-2026-108940 published to NVD
- 2026-10-14 - Last updated in NVD database
Technical Details for CVE-2026-108940
Vulnerability Analysis
The vulnerability is a classic path traversal issue in an HTTP-exposed calibration endpoint. The CalibrationApplyRequest struct accepts an optional save_cimatrix field that was previously treated as a filesystem path. Because the server did not constrain the value to a bare file name, a remote client could submit input containing directory separators or parent-directory references such as ../../etc/mistral.conf. The server would then write the collected imatrix data to the attacker-controlled location, limited only by the process's filesystem permissions.
The fix adds a validator, http_save_cimatrix_path, which rejects any input containing / or \ and requires the path to resolve to a single Component::Normal entry. Remote callers are therefore restricted to writing within the server's working directory.
Root Cause
The root cause is improper input validation of a user-supplied filename passed into a file write operation. The save_cimatrix: Option<String> field was deserialized directly into a Path without sanitization, violating the principle of trusting remote input. The documentation previously described the field as a path rather than a bare file name, reflecting the original design assumption.
Attack Vector
An unauthenticated attacker sends a crafted HTTP request to the calibration apply endpoint with a save_cimatrix value containing traversal sequences. The server writes the .cimatrix output to the resolved path, potentially overwriting configuration files, model artifacts, or other sensitive host content.
/// Request body for applying online calibration.
#[derive(Debug, Clone, Deserialize, Serialize, ToSchema)]
pub struct CalibrationApplyRequest {
- /// Optionally save the collected imatrix to this `.cimatrix` path before requantizing.
+ /// Optionally save the collected imatrix to this `.cimatrix` file name in the server's working directory.
#[serde(default)]
pub save_cimatrix: Option<String>,
}
+// remote clients only get a bare file name so the write can't leave the working directory
+fn http_save_cimatrix_path(name: &str) -> Result<std::path::PathBuf, ApiError> {
+ let path = std::path::Path::new(name);
+ let bare = !name.contains(['/', '\\'])
+ && matches!(
+ path.components().collect::<Vec<_>>().as_slice(),
+ [std::path::Component::Normal(_)]
+ );
+ if !bare {
+ return Err(ApiError::invalid_request(format!(
+ "`save_cimatrix` must be a bare file name, got `{name}`"
+ )));
+ }
+ Ok(path.to_path_buf())
+}
Source: GitHub Commit 8c81056712709b4845ec6d9531e4d35bab4a367c
Detection Methods for CVE-2026-108940
Indicators of Compromise
- HTTP request bodies to the calibration apply endpoint containing save_cimatrix values with /, \, .., or absolute path prefixes.
- Unexpected .cimatrix files appearing outside the Mistral.rs server working directory.
- Modification of configuration files, model weights, or system files owned by the Mistral.rs service account around the time of a calibration request.
Detection Strategies
- Inspect reverse proxy and application logs for POST requests to the calibration endpoint and parse save_cimatrix values for traversal patterns.
- Monitor the Mistral.rs process for file writes outside the designated working directory using filesystem auditing (auditd, eBPF, or equivalent).
- Compare running binary version against the fixed release v0.9.4 across inventory to identify vulnerable deployments.
Monitoring Recommendations
- Enable request-body logging on upstream proxies for the Mistral.rs HTTP API, with care taken to redact sensitive fields.
- Alert on write syscalls originating from the Mistral.rs process that target paths outside its working directory.
- Track outbound anomalies and process-tree changes on hosts running Mistral.rs, since arbitrary file overwrite can lead to code execution via overwritten startup or model-loading files.
How to Mitigate CVE-2026-108940
Immediate Actions Required
- Upgrade Mistral.rs to version 0.9.4 or later, which contains commit 8c81056712709b4845ec6d9531e4d35bab4a367c.
- Restrict network exposure of the Mistral.rs HTTP API to trusted clients using firewall rules or a reverse proxy with authentication.
- Run the server under a least-privileged user account with write access limited to its working directory.
Patch Information
The fix is released in Mistral.rs v0.9.4 via pull request #2445. The patch introduces http_save_cimatrix_path, which enforces that remote-supplied save_cimatrix values are a single bare file name with no directory separators. Full technical context is available in the VulDB CVE Report.
Workarounds
- Deploy a reverse proxy rule that rejects requests to the calibration endpoint when save_cimatrix contains /, \, or ...
- Omit the save_cimatrix field entirely from client requests until upgrading, and disable the calibration endpoint if it is not required.
- Run Mistral.rs inside a container or chroot with a read-only root filesystem and a dedicated writable working directory.
# Example: block traversal payloads at an Nginx reverse proxy
location /calibration/ {
if ($request_body ~* "save_cimatrix\"\s*:\s*\"[^\"]*[\\/]") {
return 400;
}
proxy_pass http://mistralrs_backend;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

