Vulnerability DatabaseGHSA-cgw6-f3mj-h742

GHSA-cgw6-f3mj-h742
Rust vulnerability analysis and mitigation

Overview

A directory traversal vulnerability was discovered in the rust-embed package affecting versions prior to 6.3.0. The vulnerability, identified as GHSA-cgw6-f3mj-h742, was discovered on November 27, 2021, and published to the GitHub Advisory Database on June 17, 2022. The issue occurs when running in debug mode and the debug-embed feature (which is off by default) is not enabled, where the generated get method fails to verify if the input path is a child of the specified folder (RustSec Advisory, GitHub Advisory).

Technical details

The vulnerability is classified as CWE-22 and carries a Moderate severity rating. The issue stems from the get method's implementation, which fails to properly validate file paths. When the application runs in debug mode without the debug-embed feature enabled, attackers can manipulate file paths to access files outside the intended directory structure. This is achieved through path traversal sequences (../), allowing access to arbitrary files in the filesystem when an attacker controls the filename input (GitHub Advisory).

Impact

The vulnerability enables attackers with control over filename inputs to read arbitrary files from the system's filesystem. For example, an attacker could potentially access sensitive system files such as /etc/passwd by using path traversal sequences, leading to unauthorized access to confidential system information (RustSec Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 6.3.0 of rust-embed. The fix involves canonicalizing the input filename and ensuring it starts with the canonicalized folder path, preventing directory traversal attempts. Users are advised to upgrade to version 6.3.0 or later to address this security issue (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

“Best User Experience I have ever seen, provides full visibility to cloud workloads.”
David EstlickCISO
“Wiz provides a single pane of glass to see what is going on in our cloud environments.”
Adam FletcherChief Security Officer
“We know that if Wiz identifies something as critical, it actually is.”
Greg PoniatowskiHead of Threat and Vulnerability Management