Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks. But this is such a antiuser feature, like the incident was like

1 I use std function to get a temp file path

2 I write content in that file

3 I do all the checks to ensure the write worked, I use std functions to check file exists

4 I use std function to print the file path

And the file path is a lie, It all would be fine if it would use the real path, and if a newb would hardocde "/tmp/file1" then I would be happy with a error message that I can't write there .

I assume they had some reasons for the lie, I am not convinced it was worth it, I do not like magic hidden stuff.



I've been bitten by this, so I know the feeling. Once you know what's going on, it's not magic anymore :-)

The "antifeature" can be disabled if you don't like it, but keep in mind that it increases security. There have been vulnerabilities related to temporary files [1][2]. Usually there is no need for a web server running in production to make its temporary files accessible to the rest of the world.

The "lie" is similar to what happens when you're using virtual machines. The virtual machine thinks it's using some hardware, but in reality...

On a side note, Flatpak also does this by default sometimes. It can run applications in a sandbox in which even the home directory is partially inaccessible.

[1]: https://cwe.mitre.org/data/definitions/377.html

[2]: https://nvd.nist.gov/vuln/search/results?form_type=Advanced&...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: