News for hackers. Stuff that matters.
Re:On Linux, 'less' can probably get you owned by x0x0 on Monday November 24, 2014 @03:10AM (#8651466)
Yet when apple makes a sandbox for apps -- which is basically this design, yet usable by people who don't understand software construction or libs -- people shriek. A sandbox is a security boon for the vast majority of people. And I think this is the only way to get reasonable security; we've been banging on this "reduce bugs" plan for at least a decade with much less progress than one would hope to show for it.
Re:On Linux, 'less' can probably get you owned by Perdition on Monday November 24, 2014 @04:04AM (#8651556)
People shriek because Apple isn't giving the device owner any option to get around the security if they want to.

Apple aren't using that model just for security, but also so they can tightly control the platform and restrict what the device owner can do on it.

Re:On Linux, 'less' can probably get you owned by x0x0 on Monday November 24, 2014 @04:11AM (#8651574)
on my mac:

   apple -> system preferences
   security + privacy
   General tab
   Under "allow apps downloaded from:"
   * Anywhere
As for ios, if you don't believe that users would click "yes" to whatever dialogue was required to make an app run, you simply don't interact with users. Allowing users to opt-out defeats the purpose. For example, my so's mother regularly gets her gmail hacked because she will respond to any google-skinned input box asking for her password. The only way to secure the majority of users is to not allow them through their actions to un-secure themselves.

Why is it ok on mac? Because many computer users are still dependent on non-appstore distributed software. Particularly developers. Nobody has evolved that dependency on ios, so it's not necessary.

Re:On Linux, 'less' can probably get you owned by Perdition on Monday November 24, 2014 @04:34AM (#8651619)
> As for ios, if you don't believe that users would click "yes" to whatever dialogue was required to make an app run, you simply don't interact with users. Allowing users to opt-out defeats the purpose.

It does not require "Click here to get owned" level of work around. I'm perfectly fine with needing to boot into the equivalent of single user mode and entering some security key. But if I want to break the security model on a device I own I should be able to.

> Why is it ok on mac? Because many computer users are still dependent on non-appstore distributed software. Particularly developers. Nobody has evolved that dependency on ios, so it's not necessary.

That is circular reasoning. The "dependency" doesn't exist on iOS because Apple tries very hard to prevent non-appstore distribution being a viable avenue for app developers.

Re:On Linux, 'less' can probably get you owned by janfoeh on Monday November 24, 2014 @04:35AM (#8651622)
> People shriek because Apple isn't giving the device owner any option to get around the security if they want to.

You are misinformed. Right click -> Open instead of double click overrides my current signing requirements and executes the app anyway.

Re:On Linux, 'less' can probably get you owned by hueving on Monday November 24, 2014 @05:08AM (#8651714)
Where do I right click on my iPhone?
Re:On Linux, 'less' can probably get you owned by Perdition on Monday November 24, 2014 @05:17AM (#8651729)
I was talking about iOS. I've never heard anyone "shriek" about this issue in regards to OSX.
Re:On Linux, 'less' can probably get you owned by gurkendoktor on Monday November 24, 2014 @05:26AM (#8651761)
I think that Apple is, on the whole, doing the right thing. But it's unfortunate that these three things (kind of) coincide:

* The Mac App Store's business model, i.e. no upgrade pricing, no trial versions; content-wise, nothing that you wouldn't sell in Disneyland

* Paying $99/yr for a developer account, even for free apps

* App sandboxing

And even then, this still doesn't mean that all apps on the App Store are safe. Because you used to be able to submit unsandboxed apps; as far as I know, they have never been removed? Sigh...

But at least many of the currently un-sandboxed apps are moving to the browser (MS Office & Skype being my biggest worries).

Re:On Linux, 'less' can probably get you owned by x0x0 on Tuesday November 25, 2014 @05:44PM (#8660224)
I totally agree.

But here's the thing: if you want a secure platform usable by the majority of people, the best choice (by a lot) is ios, followed by osx. The app store is certainly imperfect, but hopefully that will get tightened up over the next couple years.

Relatives who've been hacked ask for how not to get hacked, and my best answer is the above: use ios, particularly for banking. For a laptop, use osx and buy programs either from well known brands (adobe, microsoft) or buy app-store apps.

Re:On Linux, 'less' can probably get you owned by higherpurpose on Monday November 24, 2014 @03:35AM (#8651500)
It's ironic that even Android now has SELinux enforced by default, yet most Linux distros do not, even though they had support for it since a decade ago.
Re:On Linux, 'less' can probably get you owned by vidarh on Monday November 24, 2014 @04:09AM (#8651565)
The reason for this is that SELinux is a nightmare to configure, and lots of peoples expectations break when dealing with it and they usually don't know how to fix things without just disabling SELinux entirely. For Android peoples expectation has from the beginning been set to expect to run into security restrictions.
Re:On Linux, 'less' can probably get you owned by drzaiusapelord on Monday November 24, 2014 @11:48AM (#8653209)
This is what people were saying not too long ago on Windows when we'd complain that the apps didn't work if the user running them wasn't a local admin. Now you'd be hard pressed to find non-legacy software that doesn't work as a non-admin. In the commercial world, pressure can be brought down from on high - executives and IT purchasers discriminating against shitty software. What about FOSS? If the community has a 'meh' attitude with SELinux then things won't be easily SELinux compatible because devs don't give a shit. The same way most devs don't give a shit about most security related topics.

I'm really worried that Linux has become a liability. The lax security practices of the culture its part of are obvious. What now? Do we migrate to OpenBSD? I've been considering this at work. It just seems that the culture surrounding OpenBSD just takes security more seriously.

The idea that we can just put a application on the internet sounds dangerous to me. If its isn't hardened by something like apparmor/selinux and also behind some kind of application-level firewall (or at least snort), then we're just asking for trouble. Something has to change. The status quo is now failing us. How many high-priority patches have there been in the FOSS world this year?

Sadly, I worry more about my linux machines than my windows machines.

Re:On Linux, 'less' can probably get you owned by jfindley on Monday November 24, 2014 @05:00AM (#8651683)
That's much, much less true than it used to be. These days there's great tools for managing and modifying selinux policy, and much better reporting of what was denied, when and why, and how to fix it.

The "Selinux is too hard for mortals" thing is a relic from the early days of its inclusion into linux, and turning around this attitude is important.

Re:On Linux, 'less' can probably get you owned by badgersandjam on Monday November 24, 2014 @06:17AM (#8651877)
I disagree. The tools are awful and terribly slow to execute at best. Then you occasionally get shafted with a relabel.
Re:On Linux, 'less' can probably get you owned by jfindley on Monday November 24, 2014 @07:34AM (#8652083)
Can you be more specific? There's lots of different tools available - there might be some better options available than what you're using. And while tools that change things (e.g. setting booleans, changing context rules, etc) are unlikely to be instant in the near future, as the policy needs to be re-compiled, this has been improved, particularly for booleans. You can also batch updates together, which is a much nicer experience if you're trying to set a bunch of things at once. e.g. semanage -i <( echo -e "boolean -m --on httpd_use_nfs\n boolean -m --on httpd_use_sasl") That said, "this admin command I rarely use takes 30s to run" (30s seems to be about the average on RHEL 6/7) is to me an odd reason to try to avoid an important security feature.

I don't recall the last time I had to do a full relabel on a production system. Not saying it hasn't happened, but I can't recall an instance.

Overall, I spend less time managing SELinux (and that includes the custom policies I maintain) than I do managing IPTables. It's really not the nightmare it's made out to be.

Re:On Linux, 'less' can probably get you owned by viraptor on Monday November 24, 2014 @05:29AM (#8651767)
Depends how well integrated it is into the system. I tried to add any MAC to my Arch and discovered that: 1. doing everything from scratch for Tomoyo, including plugging it into grub config and creating your own policies is easier than even getting proper tools for selinux 2. Tomoyo behaves like Apparmor (policies on names not inodes), but can do more (ioctls, devices, more granular network controls) 3. Nobody uses Tomoyo and I really don't get why...
Re:On Linux, 'less' can probably get you owned by jfindley on Monday November 24, 2014 @06:43AM (#8651949)
Yeah, it's going to be an uphill struggle on any distro that it isn't already well integrated into - there's a lot of effort that goes into making SELinux in fedora/RHEL/etc JustWork(tm). Duplicating this on a distro without tight SELinux integration is going to be hard - but I tend to feel that if you use arch, linux from scratch or other similar distro, it's not really fair to blame SELinux ;)
Re:On Linux, 'less' can probably get you owned by vidarh on Monday November 24, 2014 @11:01AM (#8652952)
It's not that it's too hard for mortals, but that it provides a level of resistance people are not used to, and don't know how to deal with, and where the easiest solution is to turn it off.

Whereas on Android, people expect the barrier, and developers don't expect to be able to disable it.

Re:On Linux, 'less' can probably get you owned by slgeorge on Monday November 24, 2014 @04:15AM (#8651585)
What "most Linux distros" are you talking about?

Ubuntu has Mandatory Access Control in the form of AppArmor (https://wiki.ubuntu.com/AppArmor). It's switched on with a set of policies on the desktop (do sudo apparmor_status to see) and on the server.

On the mobile side a lot of work has been done to confine individual applications in a manner similar to Android. That's future work that could go into mainstream Linux eventually.

On the traditional server side both RedHat and SUSE have MAC on by default - for them SELinux I believe.

Re:On Linux, 'less' can probably get you owned by Igglyboo on Monday November 24, 2014 @10:38AM (#8652829)
You can't opt-out of Apple's sandbox.
Re:On Linux, 'less' can probably get you owned by alwillis on Monday November 24, 2014 @05:05PM (#8654995)
Apparently you can opt-out at some level.

I’m running Yosemite 10.10.1; according to Activity Monitor, Dropbox, VimR and Terminal aren’t sandboxed.

Of course, many low-level processes aren’t sandboxed either.

Re:On Linux, 'less' can probably get you owned by tormeh on Monday November 24, 2014 @03:35AM (#8651502)
If only we could abandon c and c++. That would make most security bugs go away. Source: Mozilla
Re:On Linux, 'less' can probably get you owned by jeffdavis on Monday November 24, 2014 @04:00AM (#8651548)
The problem described in this post is beyond just a buffer overrun. It's about pulling in huge numbers of libraries for a few conveniences.

Rust can't save you from that; pulling in libraries makes it way too easy to increase the surface area of your code by several orders of magnitude. Even assuming rust offers an order of magnitude better security than C/C++, it still can't keep up. Sure, it mitigates things a little, but only until the next whiz-bang library gets linked in (even if it's written in rust, it will have some flaws).

In other words, the security of a program is based on the absolute number of bugs in it; but a programming language can't do much more than reduce the ratio of bugs to program size.

The OS is in a much better position to address the problem.

Re:On Linux, 'less' can probably get you owned by jschwartzi on Monday November 24, 2014 @05:04AM (#8651697)
Even including a standard C/C++ library can contribute unknown bugs. I have a prototype system on which the software crashed about once every 3 days until I updated the C library.
Re:On Linux, 'less' can probably get you owned by Havvy on Monday November 24, 2014 @03:41AM (#8651512)
It would make most security bugs caused by unsafe by default memory management which do account for a high percentage of security bugs, but logic bugs also cause security issues. See for instance SQL Injection attacks.
Re:On Linux, 'less' can probably get you owned by tormeh on Monday November 24, 2014 @03:57AM (#8651541)
Yes, but I can't help but imagine how an OS written in Rust would look. Probably a lot better than what we have today. A combination of Rust and D would probably be capable of doing everything C and C++ can, and much better.
Re:On Linux, 'less' can probably get you owned by 72deluxe on Monday November 24, 2014 @04:35AM (#8651620)
Let the language wars commence!

In reality, there is nothing wrong with C++, particularly not modern C++ (since c++11) as the approaches laid out in Stroustrup's book discourage writing C++ in the old-fashioned "let's throw pointers around!" approach.

As with ANY language, if you write it badly, bad things will happen. The language choice doesn't mean bug-free code.

Re:On Linux, 'less' can probably get you owned by zxcdw on Monday November 24, 2014 @04:59AM (#8651681)
> In reality, there is nothing wrong with C++, particularly not modern C++ (since c++11) as the approaches laid out in Stroustrup's book discourage writing C++ in the old-fashioned "let's throw pointers around!" approach.

So, in essence this would mean to many that Rusts safety focus happens too late for it to be a big enough benefit for having to give up the investment in modern C++? As in, memory safety is a solved problem with modern C++?

Re:On Linux, 'less' can probably get you owned by 72deluxe on Monday November 24, 2014 @05:37AM (#8651789)
Yes, modern C++ is far safer than the old style or passing pointers all over the place and wondering who was deleting them (not that I ever did that - you could pass const pointers to stop others deleting them anyway; it was only a problem if you didn't obey const-correctness and make certain classes "container" classes).

The addition of move semantics and using references everywhere makes pointers unnecessary for the most part. You can use STL containers for putting your items into so shouldn't see raw "new" or "delete" operations in your own code very much; this is particularly true where you define your own move operators and move constructors.

It's a difficult habit to break though!

See Stroustrup's "The C++ Programming Language Fourth Edition" (the blue book) section 3.3.3 Resource Management and 3.2.1.2 "A Container", where in this early part of the book Stroustrup explicitly directs to 'avoid "naked" new and delete operations" and to "use resource handles and RAII to manage resources".

See std::move to force moving where it isn't clear that you're moving things.

Further reading: http://en.cppreference.com/w/cpp/language/move_operator http://stroustrup.com/C++11FAQ.html#default2

Re:On Linux, 'less' can probably get you owned by pjmlp on Monday November 24, 2014 @06:36AM (#8651933)
The sad reality that I came to realize from this year's CppCon is that most C++ developers out there will just keep on writing pre-C++98 code, due to multiple reasons like style guides, company policy, old code bases and so on.

Only greefield projects can benefit from modern C++ and there are very few out there.

After reading the updated version of Effective C++, I doubt the average C++ developer will be able to deal with a mixed codebase of pre-C++98, C++98, C++03, C++11 and C++14.

Re:On Linux, 'less' can probably get you owned by 72deluxe on Monday November 24, 2014 @07:28AM (#8652061)
This is very true. I am writing new software for my dayjob but I am stuck with VC2010 on Windows. Despite having Xcode under Mac OS, I have to write old-fashioned C++ as VC2010 doesn't support anything new!

But it helps to learn the new stuff and apply it within my own projects as best I can.

Re:On Linux, 'less' can probably get you owned by userbinator on Monday November 24, 2014 @09:46AM (#8652561)
See for instance SQL Injection attacks.

Or more recently and widely publicised, ShellShock.

Re:On Linux, 'less' can probably get you owned by Dewie on Monday November 24, 2014 @04:55AM (#8651672)
> , but logic bugs also cause security issues. See for instance SQL Injection attacks.

Though it seems that some languages, or at least how they are used, are more disciplined when it comes to treating things like SQL queries/commands; that they don't treat them as plain text, and instead assign some kind of structure/typing to the query command. Or don't they? I don't really know how SQL injections are handled in such languages, but I do know that some like to be more principled when it comes to SQL queries/commands in the source code text; like using macros to ensure that an SQL query doesn't have a typo in it. Maybe that kind of practice extends to validating user input.

Re:On Linux, 'less' can probably get you owned by mikeash on Monday November 24, 2014 @11:06AM (#8652980)
Strings are a big security hole that doesn't get nearly enough attention.

Conceptually there are a ton of different string types. File names, path names, SQL query templates, SQL query strings, URLs, URL query parameters, command line arguments, full command lines, human-readable text.... Yet just about everything gloms them together into one "string" type. Even APIs that allow for structured construction of SQL queries tend to rely on the programmer not to put arbitrary data in the template bits. These really should all be completely separate types requiring conversion.

Re:On Linux, 'less' can probably get you owned by jeffdavis on Monday November 24, 2014 @03:56AM (#8651539)
"people shriek"

Can you expand on that?

Re:On Linux, 'less' can probably get you owned by x0x0 on Monday November 24, 2014 @04:00AM (#8651549)
there's a search function on hn; most combinations of osx, sandbox, app, apple will yield results

just one example: https://news.ycombinator.com/item?id=3191021