Is there a way to open the walked files entries and avoid TOCTOU race condition security vulnerability?
Ideally DirEntry should have a method that returns a fs::File.
Without this method all people application using a walkdir->open pattern are vulnerable to TOCTOU attacks.
Meaning that an attacker can change the file (content, permissions, or attributes) between the walk and the open action which is a common attack vector.
Hello team,
I hope you well!
Is there a way to open the walked files entries and avoid TOCTOU race condition security vulnerability? Ideally DirEntry should have a method that returns a fs::File. Without this method all people application using a walkdir->open pattern are vulnerable to TOCTOU attacks. Meaning that an attacker can change the file (content, permissions, or attributes) between the walk and the open action which is a common attack vector.
https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use
Have a nice day. @chaignc