Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

The Stack Clash (Major Vulnerability found in Linux, Solaris, Free/Net/OpenBSD)
Qualys Security Labs Blog ^ | Jun 19, 2017 | Qualys Research Team

Posted on 06/20/2017 2:52:48 PM PDT by dayglored

Note from dayglored: This article is about a flaw in the *IX systems -- Linux, FreeBSD, NetBSD, OpenBSD, Solaris. It does NOT apply to Windows, nor as far as I can tell, to OS X (even though OS X is based on FreeBSD).


What is the Stack Clash?

The Stack Clash is a vulnerability in the memory management of several operating systems. It affects Linux, OpenBSD, NetBSD, FreeBSD and Solaris, on i386 and amd64. It can be exploited by attackers to corrupt memory and execute arbitrary code.

Qualys researchers discovered this vulnerability and developed seven exploits and seven proofs of concept for this weakness, then worked closely with vendors to develop patches. As a result we are releasing this advisory today as a coordinated effort, and patches for all distributions are available June 19, 2017. We strongly recommend that users place a high priority on patching these vulnerabilities immediately.

What is the Stack Clash vulnerability, precisely?

Each program running on a computer uses a special memory region called the stack. This memory region is special because it grows automatically when the program needs more stack memory. But if it grows too much and gets too close to another memory region, the program may confuse the stack with the other memory region. An attacker can exploit this confusion to overwrite the stack with the other memory region, or the other way around.

Why is it called the Stack Clash?

The first step in exploiting this vulnerability is to collide, or clash, the stack with another memory region. Hence the name: the Stack Clash.

Is it a new vulnerability?

The idea of clashing the stack with another memory region is not new: it was exploited a first time in 2005 and a second time in 2010. After the 2010 exploit, Linux introduced a protection against such exploits: the so-called stack guard-page. Today, we show that stack clashes are widespread and exploitable despite the stack guard-page protection.

Is the Stack Clash one or several vulnerabilities?

Our primary Stack Clash vulnerability is CVE-2017-1000364 and demonstrates that a stack guard-page of a few kilobytes is insufficient. But during our research we discovered more vulnerabilities: some are secondary and directly related to the primary Stack Clash vulnerability (for example, CVE-2017-1000365), and some are exploitable independently (for example, CVE-2017-1000367).

Am I affected by the Stack Clash?

If you are using Linux, OpenBSD, NetBSD, FreeBSD, or Solaris, on i386 or amd64, you are affected. Other operating systems and architectures may be vulnerable too, but we have not researched any of them yet: please refer to your vendor’s official statement about the Stack Clash for more information.

What are the risks posed by the Stack Clash?

The exploits and proofs of concept that we developed in the course of our research are all Local Privilege Escalations: an attacker who has any kind of access to an affected system can exploit the Stack Clash vulnerability and obtain full root privileges.

Is it exploitable remotely?

Our research has mainly focused on local exploitation: as of this writing on June 19, 2017, we do not know of any remotely exploitable application. However, remote exploitation of the Stack Clash is not excluded; although local exploitation will always be easier, and remote exploitation will be very application-specific. The one remote application that we did investigate (the Exim mail server) turned out to be unexploitable by sheer luck.

How can I protect my system from the Stack Clash?

The easiest and safest way to protect your system is to update it: we have been working with the affected vendors since the beginning of May, and by the time you read this, their patches and updates will be available.

What if I can’t (or don’t want to) update or reboot my system?

As a temporary workaround, you may set the hard RLIMIT_STACK and RLIMIT_AS of your local users and remote services to some reasonably low values. Use this workaround at your own risk, however: most likely your limits will not be low enough to resist all attacks (for example, in some cases our Sudo stack-clash exploit allocates merely 137MB of heap memory, and almost no stack memory); or your limits will be too low and will break legitimate applications.

Where can I find the Stack Clash exploits?

We will eventually publish our exploits and proofs of concept, but not immediately: we will only do so after users had enough time to patch their systems.

Where can I get more information?

Please refer to the Stack Clash security advisory for the full technical details.

OR:

Refer to the vendor advisories, which we are listing here as they become available:

SUSE
https://www.novell.com/support/kb/doc.php?id=7020973

Red Hat
https://access.redhat.com/security/vulnerabilities/stackguard

Debian
https://www.debian.org/security/2017/dsa-3886
https://www.debian.org/security/2017/dsa-3887
https://www.debian.org/security/2017/dsa-3888
https://www.debian.org/security/2017/dsa-3889

Ubuntu
https://www.ubuntu.com/usn/

OpenBSD
https://ftp.openbsd.org/pub/OpenBSD/patches/6.1/common/008_exec_subr.patch.sig

Oracle Solaris
http://www.oracle.com/technetwork/security-advisory/alert-cve-2017-3629-3757403.html

I want to write my own Stack Clash exploit, where do I start?

You should try to implement the local-root exploit against Exim on i386 Debian: it is by far the easiest and most representative Stack Clash exploit.

Is the Sudo vulnerability Qualys published on May 30 related to Stack Clash?

https://www.qualys.com/2017/06/14/cve-2017-1000367/cve-2017-1000367.txt https://www.qualys.com/2017/06/14/cve-2017-1000367/linux_sudo_cve-2017-1000367.c

If CVE-2017-1000367 is combined with the Stack Clash, any local user (not just Sudoers) can exploit Sudo to obtain full root privileges on any vulnerable Linux system (not just SELinux systems). Because CVE-2017-1000367 was exploitable independently of the Stack Clash, we (and the affected vendors) decided to not wait for the June 19 Coordinated Release Date and published it on May 30.


TOPICS: Business/Economy; Computers/Internet; Hobbies
KEYWORDS: bsd; linux; vulnerability; windowspinglist
Navigation: use the links below to view more comments.
first 1-2021-32 next last
This is -- for once -- NOT a Windows or OS X flaw. This affects the *IX systems.
1 posted on 06/20/2017 2:52:48 PM PDT by dayglored
[ Post Reply | Private Reply | View Replies]

To: Abby4116; afraidfortherepublic; aft_lizard; AF_Blue; amigatec; AppyPappy; arnoldc1; ATOMIC_PUNK; ...
For the Linux and BSD users on the Windows Ping List ... PING!

You can find all the Windows Ping list threads with FR search: just search on keyword "windowspinglist".

For once, Windows users (and OS X users) can breathe easy -- this one is not for them.

2 posted on 06/20/2017 2:54:07 PM PDT by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government.")
[ Post Reply | Private Reply | To 1 | View Replies]

To: Swordmaker
Hi Swordmaker,

You might want to do your own verification about the apparent non-susceptibility of OS X / macOS to this one. I can't tell from this article (since it doesn't say specifically), but it does not appear to apply to Mac and Windows.

3 posted on 06/20/2017 2:56:53 PM PDT by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government.")
[ Post Reply | Private Reply | To 2 | View Replies]

To: dayglored

4 posted on 06/20/2017 2:57:02 PM PDT by Red Badger (Unless you eat The Bread of Life, you are toast!.......................)
[ Post Reply | Private Reply | To 2 | View Replies]

To: Red Badger

Somebody HAD to do that. :-)


5 posted on 06/20/2017 3:04:45 PM PDT by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government.")
[ Post Reply | Private Reply | To 4 | View Replies]

To: dayglored

How many folks are still running 386 processors? AMD 64 I can see.


6 posted on 06/20/2017 3:07:31 PM PDT by PAR35
[ Post Reply | Private Reply | To 1 | View Replies]

To: dayglored

We have a Linux mainframe...not connected to the internet.


7 posted on 06/20/2017 3:15:21 PM PDT by AppyPappy (Don't mistake your dorm political discussions with the desires of the nation)
[ Post Reply | Private Reply | To 2 | View Replies]

To: PAR35

i386 refers to the chip architecture of 386, 486 and Pentium - in other words, virtually all Intel chips for the past 20 years.


8 posted on 06/20/2017 3:17:29 PM PDT by proxy_user
[ Post Reply | Private Reply | To 6 | View Replies]

To: dayglored

This is a local privilege escalation vulnerability. The attacker has to have an account on the *nix machine and be able to log on as an ordinary user, in order to try to become root.

This is very different from attacks over the internet. While a user could log in remotely with SSH, he still needs an local ID and password to connect.


9 posted on 06/20/2017 3:19:53 PM PDT by proxy_user
[ Post Reply | Private Reply | To 1 | View Replies]

To: proxy_user

I’ve usually seen x86 used to refer to the family, 386 to refer to a specific version.


10 posted on 06/20/2017 3:24:08 PM PDT by PAR35
[ Post Reply | Private Reply | To 8 | View Replies]

To: dayglored

Does this affect Android, which is also based on Linux?


11 posted on 06/20/2017 3:27:32 PM PDT by Gideon7
[ Post Reply | Private Reply | To 1 | View Replies]

To: PAR35

I still have an AMD Athlon XP 1200 running XP. I use it for usenet and some old games. FF won’t update, and the last K-lite wouldn’t install because of the lack of hw features.


12 posted on 06/20/2017 3:37:02 PM PDT by Calvin Locke
[ Post Reply | Private Reply | To 6 | View Replies]

To: Gideon7; ThunderSleeps

Good question. Thundersleeps?


13 posted on 06/20/2017 3:38:08 PM PDT by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government.")
[ Post Reply | Private Reply | To 11 | View Replies]

To: dayglored
> This is -- for once -- NOT a Windows or OS X flaw. This affects the *IX systems.

That's (almost certainly) a big negative there good buddy.

MacOS IS an officially branded UNIX which is based on darwin, a BSD variant.
I can't see how this would not effect MacOS, expect to hear about a patch very soon.

Ironically this is the 1 in a 1000 security vulnerability which does NOT involve Windows .... P.S. Here is an in depth linky about it for your inner geek (https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt )

14 posted on 06/20/2017 3:38:24 PM PDT by SecondAmendment (Restoring our Republic at 9.8357x10^8 FPS)
[ Post Reply | Private Reply | To 1 | View Replies]

To: SecondAmendment

I would think that if OS X / macOS was affected The articles offers would have mentioned it. It is certainly widely known that they are based on FreeBSD. I pinged swordmaker above to please double check.


15 posted on 06/20/2017 3:44:05 PM PDT by dayglored ("Listen. Strange women lying in ponds distributing swords is no basis for a system of government.")
[ Post Reply | Private Reply | To 14 | View Replies]

To: PAR35

Yes, but this is what they say in Linux-land, when they offer distros for download.


16 posted on 06/20/2017 3:46:27 PM PDT by proxy_user
[ Post Reply | Private Reply | To 10 | View Replies]

To: dayglored
>I would think that if OS X / macOS was affected The articles offers would have mentioned it.

The author's of the article said there very well could be more OS's effected by this these are the only ones they have checked so far.

Believe me, I am not gleeful about this at all, I am a big MacOS user, but to be honest, I have seen Apple drag its proverbial feet on security fixes from time to time ...

17 posted on 06/20/2017 3:49:18 PM PDT by SecondAmendment (Restoring our Republic at 9.8357x10^8 FPS)
[ Post Reply | Private Reply | To 15 | View Replies]

To: proxy_user

So are they saying only local access as root can make this happen?

I’m gonna pass this on to my peeps on the job. But there are tons of ways of killing your linux server as root. Doesn’t require and exploit; just bad command line statements.


18 posted on 06/20/2017 4:00:00 PM PDT by jimjohn (This battle is over, but the war to rebuild the America has just begun.)
[ Post Reply | Private Reply | To 9 | View Replies]

To: proxy_user

Ok, thanks. I probably need to download a new Puppy. That’s the only distro I regularly used.


19 posted on 06/20/2017 4:16:06 PM PDT by PAR35
[ Post Reply | Private Reply | To 16 | View Replies]

To: jimjohn

No, local access as a non-root account, seeking to gain root access. Historically, there have been many ways to do this, but these holes have gradually been plugged.


20 posted on 06/20/2017 4:46:11 PM PDT by proxy_user
[ Post Reply | Private Reply | To 18 | View Replies]


Navigation: use the links below to view more comments.
first 1-2021-32 next last

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson