News for hackers. Stuff that matters.
Re:Man who thought opening a TXT file is fine thought wrong by tmp538394722 on Friday April 02, 2021 @11:32PM (#26678219)
“Everything’s a file!”
Re:Man who thought opening a TXT file is fine thought wrong by DyslexicAtheist on Saturday April 03, 2021 @05:29AM (#26679532)
> In Unix everything is a file. Files are files, folders are files, disks are files, your keyboard is a file, your mouth is a file, the air is a file, you can't breathe, your file lungs fill with files and you try to scream but only files come out oh god Dennis how could you do this

-- https://twitter.com/TartanLlama/status/1375045731644538882

Re:Man who thought opening a TXT file is fine thought wrong by rcrisan on Saturday April 03, 2021 @02:33AM (#26678810)
perhaps this is the worst possible abstraction to be protected by a security framework.
Re:Man who thought opening a TXT file is fine thought wrong by boomlinde on Saturday April 03, 2021 @05:50AM (#26679638)
How is that? Per-process namespaces in Plan 9 seem like a good idea for isolation. "Everything is a file," but what is and isn't accessible can be managed on a per-process level.

In POSIX we only generally get a user/group level of granularity which seems to practically mean that only daemons are completely isolated.

Re:Man who thought opening a TXT file is fine thought wrong by hamstergene on Sunday April 04, 2021 @12:39PM (#26690890)
Per process won’t be good enough in a different app that does legitimately need `/net`, just not when displaying file:/// links inside HTML pages.
Re:Man who thought opening a TXT file is fine thought wrong by boomlinde on Monday April 05, 2021 @01:46PM (#26702109)
I disagree. Use a second process that has a limited namespace where you've mounted only the local files you want an HTML document to be able to refer to and an IPC socket marked for exclusive use. The first process resolves file links and reads file contents via IPC to the second process.
Re:Man who thought opening a TXT file is fine thought wrong by aenario on Saturday April 03, 2021 @05:32AM (#26679544)
I can see a way this would be useful to use the same abstraction to limit app/user web access to a single domain.

For instance the dropbox binary can only access "/home/dropbox" and "/net/dropbox.com" if this was more well-known/used.

Re:Man who thought opening a TXT file is fine thought wrong by bestorworse on Sunday April 04, 2021 @05:45PM (#26693110)
This can be done with a proper capability system.
Re:Man who thought opening a TXT file is fine thought wrong by extropy on Saturday April 03, 2021 @03:47AM (#26679076)
IMO not so much. Just assume all files are malicious unless accompanied by metadata saying otherwise. That is pretty much the status quo already.

Except we have some grandfathered file types that are implicitly trusted.

Re:Man who thought opening a TXT file is fine thought wrong by Jabbles on Saturday April 03, 2021 @04:03AM (#26679150)
In the article, the remote file's contents were not malicious, but merely trying to access it was. That would require a very different security posture to "assume all files are malicious".
Re:Man who thought opening a TXT file is fine thought wrong by DyslexicAtheist on Saturday April 03, 2021 @05:32AM (#26679551)
> the remote file's contents were not malicious

until ... one day ... they are!

Re:Man who thought opening a TXT file is fine thought wrong by boomlinde on Saturday April 03, 2021 @05:52AM (#26679650)
The remote file is only one of two files in the story.
Re:Man who thought opening a TXT file is fine thought wrong by Lucasoato on Saturday April 03, 2021 @04:03AM (#26679154)
And what about malicious metadata?
Re:Man who thought opening a TXT file is fine thought wrong by ryandrake on Saturday April 03, 2021 @12:10PM (#26682152)
I don't think "everything is a file" is necessarily bad. What's worse is "every application I run has access to every resource that the OS gives my user access to".

Would be nice if the operating system could set up a fresh, temporary "user" for each application installed, and instead run the application as that user, who starts out with no access to computing resources. Maybe some existing systems already sandbox apps into their own unprivileged users, I don't know, but it would probably be very secure.

Re:Man who thought opening a TXT file is fine thought wrong by Blikkentrekker on Saturday April 03, 2021 @03:15PM (#26683851)
Modern operating systems can; there is quite granular control.

But often when such sandboxes are attempted, it turns out that it often became more complex than originally thought, and applications need many resources which were not originally considered, so they are given those resources, and very often those resources can be used again to construct more resources or otherwise to some measure escape the sandbox.

Re:Man who thought opening a TXT file is fine thought wrong by SamPatt on Monday April 05, 2021 @01:08AM (#26695549)
I believe this is how Qubes OS is supposed to operate.
Re:Man who thought opening a TXT file is fine thought wrong by eeZah7Ux on Saturday April 03, 2021 @09:18AM (#26680810)
On the contrary, it's very good design.
Re:Man who thought opening a TXT file is fine thought wrong by rualca on Saturday April 03, 2021 @10:49AM (#26681483)
> perhaps this is the worst possible abstraction to be protected by a security framework.

I honestly don't understand how anyone with at least a basic understanding of how OSes are designed and operated could ever arrive at that conclusion. The layers of wrong assumptions required to support that assertion are in the level of "not even wrong" confusions.

Re:Man who thought opening a TXT file is fine thought wrong by rualca on Saturday April 03, 2021 @10:53AM (#26681509)
> “Everything’s a file!”

I fail to see how HTTP and REST's "everything is a resource" paradigm is significantly different than UNIX's "everything is a file" paradigm, and I'm yet to see anyone claim that the freedom and power to open any HTML document (OMG a file!) made available through the internet is a mistake or a bad design decision.

Re:Man who thought opening a TXT file is fine thought wrong by wbl on Saturday April 03, 2021 @04:32PM (#26684461)
Several ways. In Unix files are streams of bytes. In HTTP resources are complex entities with MIME types, multiple representations, encodings, etc. HTTP URL structure supports parameters and there is a method for providing data and obtaining a result back, a sort of RPC.

On the other side Unix has users and permissions, HTTP does not and you have to build your own.