21 July 2021

YIKES!

+ YIKES!

Two-for-Tuesday vulnerabilities send Windows and Linux users scrambling

Both OSes have flaws that allow attackers with a toehold to elevate access.

"The world woke up on Tuesday to two new vulnerabilities—one in Windows and the other in Linux—that allow hackers with a toehold in a vulnerable system to bypass OS security restrictions and access sensitive resources.

As operating systems and applications become harder to hack, successful attacks typically require two or more vulnerabilities. One vulnerability allows the attacker access to low-privileged OS resources, where code can be executed or sensitive data can be read. A second vulnerability elevates that code execution or file access to OS resources reserved for password storage or other sensitive operations. The value of so-called local privilege escalation vulnerabilities, accordingly, has increased in recent years.

Breaking Windows

New Windows and Linux Flaws Give Attackers Highest System Privileges

The Windows vulnerability came to light by accident on Monday when a researcher observed what he believed was a coding regression in a beta version of the upcoming Windows 11. The researcher found that the contents of the security account manager—the database that stores user accounts and security descriptors for users on the local computer—could be read by users with limited system privileges.

That made it possible to extract cryptographically protected password data, discover the password used to install Windows, obtain the computer keys for the Windows data protection API—which can be used to decrypt private encryption keys—and create an account on the vulnerable machine. Make-me-admin holes found in Windows, Linux kernel - The Register - OLTNEWS

The result is that the local user can elevate privileges all the way to System, the highest level in Windows.

“I don’t know the full extent of the issue yet, but it’s too many to not be a problem I think,” researcher Jonas Lykkegaard noted. “Just so nobody is in doubt what this means, it’s EOP to SYSTEM for even sandboxed apps.” . .

The advisory explained:

If a VSS shadow copy of the system drive is available, a non-privileged user may leverage access to these files to achieve a number of impacts, including but not limited to:

  • Extract and leverage account password hashes
  • Discover the original Windows installation password
  • Obtain DPAPI computer keys, which can be used to decrypt all computer private keys
  • Obtain a computer machine account, which can be used in a silver ticket attack

Note that VSS shadow copies may not be available in some configurations; however, simply having a system drive that is larger than 128GB in size and then performing a Windows Update or installing an MSI will ensure that a VSS shadow copy will be automatically created. To check if a system has VSS shadow copies available, run the following command from a privileged command prompt:
vssadmin list shadows

Researcher Benjamin Delpy showed how the vulnerability can be exploited to obtain password hashes or other sensitive data:

Currently, there is no patch available. A Microsoft representative said company officials are investigating the vulnerability and will take appropriate action as needed. The vulnerability is being tracked as CVE-2021-36934. Microsoft said here that exploits in the wild are "more likely."

Et tu, Linux kernel?

Researchers flag 7-years-old privilege escalation flaw in Linux kernel (CVE- 2021-33909) - Help Net Security

Most versions of Linux, meanwhile, are in the process of distributing a fix for a vulnerability disclosed on Tuesday. CVE-2021-33909, as the security flaw is tracked, allows an untrusted user to gain unfettered system rights by creating, mounting, and deleting a deep directory structure with a total path length that exceeds 1GB and then opening and reading the /proc/self/mountinfo file

“We successfully exploited this uncontrolled out-of-bounds write and obtained full root privileges on default installations of Ubuntu 20.04, Ubuntu 20.10, Ubuntu 21.04, Debian 11, and Fedora 34 Workstation,” researchers from Qualys, the security firm that discovered the vulnerability and created proof-of-concept code that exploits it, wrote. “Other Linux distributions are certainly vulnerable, and probably exploitable.”

The exploit Qualys described comes with significant overhead, specifically roughly 1 million nested directories. The attack also requires about 5GB of memory and 1 million inodes. Despite the hurdles, a Qualys representative described the PoC as “extremely reliable” and said it takes about three minutes to complete.

INSERT >

Linux users may generally be able to say that their computers are more secure than Windows PCs, but that doesn’t mean they’re invulnerable, as this newly-identified exploit demonstrates. Spotted by Qualys, the size_t-to-int type conversion vulnerability likely affects most Linux OSes, the researchers warn.

“Qualys security researchers have been able to independently verify the vulnerability, develop an exploit, and obtain full root privileges on default installations of Ubuntu 20.04, Ubuntu 20.10, Ubuntu 21.04, Debian 11, and Fedora 34 Workstation,” Bharat Jogi, Senior Manager of Vulnerabilities and Signatures at Qualys, explains. “Other Linux distributions are likely vulnerable and probably exploitable.”

The security team notified Red Hat Product Security of CVE-2021-33909 and CVE-2021-33910, alerting vendors and open-source distribution about the vulnerabilities. If you’re running a Linux system, you should be looking to see if there are patches for your computer as a matter of urgency. A Qualys representative told ArsTechnica that it would take just three minutes or so to undertake the exploit.

Here’s an overview of the exploit:

1/ We mkdir() a deep directory structure (roughly 1M nested directories) whose total path length exceeds 1GB, we bind-mount it in an unprivileged user namespace, and rmdir() it.

2/ We create a thread that vmalloc()ates a small eBPF program (via BPF_PROG_LOAD), and we block this thread (via userfaultfd or FUSE) after our eBPF program has been validated by the kernel eBPF verifier but before it is JIT-compiled by the kernel.

3/ We open() /proc/self/mountinfo in our unprivileged user namespace and start read()ing the long path of our bind-mounted directory, thereby writing the string "//deleted" to an offset of exactly -2GB-10B below the beginning of a vmalloc()ated buffer.

4/ We arrange for this "//deleted" string to overwrite an instruction of our validated eBPF program (and therefore nullify the security checks of the kernel eBPF verifier) and transform this uncontrolled out-of-bounds write into an information disclosure and into a limited but controlled out-of-bounds write.

5/ We transform this limited out-of-bounds write into an arbitrary read and write of kernel memory by reusing Manfred Paul's beautiful btf and map_push_elem techniques from:

https://www.thezdi.com/blog/2020/4/8/cve-2020-8835-linux-kernel-privilege-escalation-via-improper-ebpf-program-verification

Qualys has a separate writeup here.

People running Linux should check with the distributor to determine if patches are available to fix the vulnerability. Windows users should await advice from Microsoft and outside security experts.

No comments:

The European Commission is the executive branch of the European Union with the duty to uphold the law. The transparency of the Commission´s actions and decisions range from questionable to abysmal

The European Commission is the executive branch of the European Union with the duty to uphold the law.  The transparency of the Commission´s...