In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsThis was deemed not a vulnerability.
chownr is a package that takes the same arguments as fs.chown()
Affected versions of this package are vulnerable to Time of Check Time of Use (TOCTOU).
There is no readdir
that will succeed on actual directories, and fail on symlinks to directories.
The basic flow would be:
There is no readdir(3)
call that will succeed on a "real" directory, but fail on a symbolic link to a directory. What that means is that there is no atomic way to verify that, at the exact time of reading a directory, it's a real directory and not a symlink to somewhere else.
That being the case there will always be a TOCTOU issue for any recursive filesystem operation that traverses directories making changes at each level.