Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Directory traversal attack allowed when running in debug mode #159

Closed
5225225 opened this issue Nov 27, 2021 · 5 comments · Fixed by #160
Closed

Directory traversal attack allowed when running in debug mode #159

5225225 opened this issue Nov 27, 2021 · 5 comments · Fixed by #160
Labels

Comments

@5225225
Copy link

5225225 commented Nov 27, 2021

#[derive(rust_embed::RustEmbed)]
#[folder = "src/"]
struct Asset;

fn main() {
    let d = Asset::get("../../../etc/passwd").unwrap().data;
    println!("{}", String::from_utf8_lossy(&d));
}

This code will (assuming you have the correct number of ../s), print out the contents of your /etc/passwd.

@AzureMarker
Copy link
Collaborator

Thanks for the report. I'll open a PR ASAP.

@pyrossh
Copy link
Owner

pyrossh commented Nov 28, 2021

Fix is released in v6.3.0. Thanks for finding the vulnerability @5225225.
Thanks for the quick fix @AzureMarker.

@5225225
Copy link
Author

5225225 commented Nov 29, 2021

I'll file a https://rustsec.org/ vuln today to hopefully get anyone on vulnerable versions to upgrade, assuming they run cargo-audit or similar.

@5225225
Copy link
Author

5225225 commented Nov 29, 2021

Also, the readme / changelog needs to be updated.

@pyrossh
Copy link
Owner

pyrossh commented Nov 29, 2021

Ahh I forgot to push my commit. Thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants