News for hackers. Stuff that matters.
Re:Is Haskell a good choice for software security? by Buttons840 on Friday December 17, 2021 @10:22AM (#29593348)
> What does the language selection have to do with a feature request of

Only functions with certain type signatures can do IO in Haskell. This could be broken down to be more granular such that the type system makes it clear (and even somewhat of a burden) to the caller whether writing to disk happens, or network access, or both.

Imagine the entry point to your program is given all "Effects", and then must pass them down the call stack as needed to other functions. Without the appropriate Effect, a function cannot perform the Effect. People might wonder why they were required to pass the NetworkAccess Effect into their logging calls.

Re:Is Haskell a good choice for software security? by stonemetal12 on Friday December 17, 2021 @10:46AM (#29593728)
Let's just hope there is a "load and execute random code from the network" effect that you could disable.

NetworkAccess Effect wouldn't be that strange for a logging system that supports multiple networked log managers like syslog.

Re:Is Haskell a good choice for software security? by Quekid5 on Friday December 17, 2021 @11:11AM (#29594136)
The point isn't so much that you can disable effects. It's that you literally have no effects/capabilities unless specifically granted.

That said, I'm a bit skeptical that Haskell would have prevented this particular issue in practice. The logging monad would just likely just have been called a LoggingM (in MTL style) and most users would have been oblivious as to exactly what it was doing... and as you say: Logging to a remote system needs the network.

I guess what could have saved a Haskell program here is that there's no such thing as "download code and execute it with the same privileges as you" with being very explicit about that. (E.g. calling 'system' or whatever)

Re:Is Haskell a good choice for software security? by Akronymus on Friday December 17, 2021 @11:34AM (#29594489)
You could split it up into 2 functions I guess. A pure one that creates the log entry, then an IO one that actually saves it.
Re:Is Haskell a good choice for software security? by Quekid5 on Friday December 17, 2021 @03:50PM (#29598177)
Yes, but if the IO one does <shenanigans> then you're as well off. Which is... not very.

EDIT: Just to say: I don't mean to be flippant.

Re:Is Haskell a good choice for software security? by Akronymus on Friday December 17, 2021 @06:35PM (#29599630)
Oh its fine.

And i meanr it more in that one part is literally just passing the data along, while the other part generates the data with being fed whatever is needed for it to. so, if yoj want to just log a literal string yoj wouldnt provide any additional functionality to the generator.

if you want it to expand strings, then you provide a function for that. and so on

Re:Is Haskell a good choice for software security? by thesz on Friday December 17, 2021 @01:54PM (#29596632)
Accesses can be distinguished too - read and write accesses are different. You can see this in [1] - there are Reader and Writer monads, where Reader is used for effectively unchangeable parameter to a monadic context (for example, socket) and Writer is used, among other things, for logging!