Skip to content

Commit

Permalink
Add notice regarding directory traversal mitigation to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Majored committed Dec 12, 2021
1 parent 4fbf47b commit 08587b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/fs_parallel_extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ use std::sync::Arc;
use async_zip::read::fs::ZipFileReader;
use tokio::fs::File;

// NOTE: This example does not check nor mitigate any potienal directory traversal. It expects a trusted ZIP file to be
// provided. Mitigation should be added by the library implementer where needed.

#[tokio::main]
async fn main() {
let zip = Arc::new(ZipFileReader::new("./Archive.zip").await.unwrap());
Expand Down
3 changes: 3 additions & 0 deletions examples/seek_sequ_extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use std::path::Path;
use async_zip::read::seek::ZipFileReader;
use tokio::fs::File;

// NOTE: This example does not check nor mitigate any potienal directory traversal. It expects a trusted ZIP file to be
// provided. Mitigation should be added by the library implementer where needed.

#[tokio::main]
async fn main() {
let mut file = File::open("./Archive.zip").await.unwrap();
Expand Down

0 comments on commit 08587b8

Please sign in to comment.