2 ms·
Uhm yeah well now try ln -s /etc/passwd foo sudo more foo OMG! The original version is "vulnerable" too! (I did not know about that strace feature though
by IshKebab 2y ago
Uhm yeah well now try
ln -s /etc/passwd foo
sudo more foo
OMG! The original version is "vulnerable" too!
(I did not know about that strace feature though - that is very cool, thanks!)
- oguz-ismail 2y agoI thought I was gonna see an error because the stat'd file and the opened one didn't match. How disappointing
- IshKebab 2y agoNo, it just means you're checking the wrong file so you might not get the nice error message from the initial check. It's still not going to do anything incorrect when it comes to actually open the file though. TOCTOU only matters when the check is actually checking something important. Here it isn't; it's just giving nicer error messages. If you bypass it you just lose those nice error messages. So it isn't a problem here.