Security Experts:

'DirtyCred' Vulnerability Haunting Linux Kernel for 8 Years

Academic researchers from Northwestern University have shared details on ‘DirtyCred’, a previously unknown privilege escalation vulnerability affecting the Linux kernel.

Tracked as CVE-2022-2588, the security flaw can be exploited to escalate privileges, and can also lead to a container escape. The academics say the vulnerability has been present in Linux for eight years.

Described as a use-after-free in the cls_route filter implementation of the Linux kernel, the bug exists because an old filter is not removed from the hashtable before it is freed. The issue can be exploited by a local user with the CAP_NET_ADMIN capability and could lead to a system crash or arbitrary code execution.

PhD students Zhenpeng Lin and Yuhang Wu, and associate professor Xinyu Xing explained earlier this month during the Black Hat conference that the issue is similar to the Dirty Pipe vulnerability (CVE-2022-0847) impacting Linux kernel versions 5.8 and later.

What made Dirty Pipe reputable was its easy exploitation despite protections such as kernel address randomization and pointer integrity check, coupled with the fact that it could be exploited without modifications on all impacted kernel versions.

The academics claim that the DirtyCred exploitation method surpasses limitations of Dirty Pipe, which uses the Linux kernel’s pipe mechanism for injecting data into arbitrary files.

“We argue that our new exploitation method is not only more general than the dirty pipe but also more powerful. First, rather than tying to a specific vulnerability, this exploitation method allows any vulnerabilities with double-free ability to demonstrate dirty-pipe-like ability,” the academics say.

The new attack relies on the dirty-pipe-like ability to overwrite any file with read permission, in order to escalate privileges on the system.

“DirtyCred is a kernel exploitation concept that swaps unprivileged kernel credentials with privileged ones to escalate privilege. Instead of overwriting any critical data fields on kernel heap, DirtyCred abuses the heap memory reuse mechanism to get privileged. Although the concept is simple, it is effective,” the researchers say.

Basically, the attacker needs to free an in-use unprivileged credential in memory, allocate privileged credentials to the free slot, and then operate as the privileged user – which will require stabilizing file exploitations, the researchers say.

The DirtyCred exploit works without modifications across different kernels and architectures and there are no mitigations available for it as of now, according to the academics, who demonstrated their exploit on both Linux and Android.

One possible defense against DirtyCred, the researchers note, involves isolating privileged credentials from unprivileged ones in virtual memory.

DirtyCred and Dirty Pipe are similar to Dirty Cow (CVE-2016-5195), a Linux kernel vulnerability allowing local attackers to escalate privileges by modifying existing ‘setuid’ files.

Related: Google Boosts Bug Bounty Rewards for Linux Kernel Vulnerabilities

Related: DoS Vulnerabilities Impact Linux Kernel

Related: Two-Year Old Vulnerability Patched in Linux Kernel

view counter