# CVE-2021-45712: RustEmbed generated `get` method allows for directory traversal when reading files from disk

- Severity: High 7.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.65%, higher than 77% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2021-11-29T12:00:00.000Z
- Modified: 2026-06-17T04:13:59.977Z
- Also known as: GHSA-cgw6-f3mj-h742, GHSA-xrg3-hmf3-rvgw, RUSTSEC-2021-0126
- Weaknesses: CWE-22
- Assigned by: mitre

## Description

An issue was discovered in the rust-embed crate before 6.3.0 for Rust. A ../ directory traversal can sometimes occur in debug mode.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- rust-embed (crates.io): before 6.3.0; from 0.0.0-0 before 6.3.0
- rust-embed_project rust-embed: before 6.3.0

## Every score

- GitHub: rating Medium
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:P/I:N/A:N`

## References

- <https://rustsec.org/advisories/RUSTSEC-2021-0126.html> (exploit, advisory, issue-tracking, third-party-advisory, web)
- <https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/rust-embed/RUSTSEC-2021-0126.md> (exploit, third-party-advisory, web)
- <https://github.com/pyros2097/rust-embed/issues/159> (report, web)
- <https://github.com/pyros2097/rust-embed> (package)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-45712> (advisory)
- <https://crates.io/crates/rust-embed> (package)

## Sources

- CVE List: [CVE-2021-45712](https://www.cve.org/CVERecord?id=CVE-2021-45712), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-cgw6-f3mj-h742](https://github.com/advisories/GHSA-cgw6-f3mj-h742), CC-BY-4.0, modified 2023-11-08
- GitHub Advisory Database: [GHSA-xrg3-hmf3-rvgw](https://github.com/advisories/GHSA-xrg3-hmf3-rvgw), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2021-0126](https://rustsec.org/advisories/RUSTSEC-2021-0126.html), CC0-1.0, modified 2023-11-08
- NVD: [CVE-2021-45712](https://nvd.nist.gov/vuln/detail/CVE-2021-45712), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-45712 · Whole record: https://cve.day/CVE-2021-45712.json · Rebuilt by cve.day 2026-11-25T22:58:06.251Z
