Skip to content

Commit

Permalink
add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Buckram123 committed Feb 24, 2024
1 parent 639ec4d commit e7c5447
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ fn dynamic(ident: &syn::Ident, folder_path: String, prefix: Option<&str>, includ
if !canonical_file_path.starts_with(#canonical_folder_path) {
// Tried to request a path that is not in the embedded folder

// TODO: Currently it allows "path_traversal_attack" for the symlink files
// For it to be working properly we need to get absolute path first
// and check that instead if it starts with `canonical_folder_path`
// https://doc.rust-lang.org/std/path/fn.absolute.html (currently nightly)
// Should be allowed only if it was a symlink
let metadata = ::std::fs::symlink_metadata(file_path.as_path()).ok()?;
if !metadata.is_symlink() {
Expand Down

0 comments on commit e7c5447

Please sign in to comment.