Friday, November 1, 2024
HomeCyber Security News15-Year-Old Linux Netfilter Vulnerability Let Hackers Bypass All Modern Security Mitigations

15-Year-Old Linux Netfilter Vulnerability Let Hackers Bypass All Modern Security Mitigations

Published on

Malware protection

An Information Security Engineer, Andy Nguyen has recently detected a 15-Year-Old Linux Netfilter vulnerability that allows any attackers to bypass all the modern security measures.

Cybersecurity experts have tracked this 15-Year-Old Linux Netfilter vulnerability as “CVE-2021-22555,” and apart from security mitigations, they have also claimed that by exploiting this flaw threat actors can also achieve kernel code execution.

Netfilter Vulnerability

In order to be concocted by the native functions, the structures need to be transformed from user to kernel as well as 32-bit to 64-bit, when in the compatibility mode the IPT_SO_SET_REPLACE or IP6T_SO_SET_REPLACE is summoned.

- Advertisement - SIEM as a Service

Here, Andy affirmed that the security flaw is in the “xt_compat_target_from_user()” where with an offset target->targetsize “memset()” is convoked.

by names like TCPMSS, TTL, or NFQUEUE, a user can choose different targets with different structure sizes; but, here, the user won’t be able to control the targetsize.

Exploitation Chain

With 0x4C bytes primitive the usual targets are:-

The security expert, Andy remarked that he won’t able to allocate any victim objects around struct xt_table_info on kernel 5.4 while he was playing around some victim objects.

But, according to Jann Horn earlier to implement accounting separate slabs were used before 5.9; that’s why in the exploit chain the primitive used by Andy should also use the “GFP_KERNEL_ACCOUNT.”

Here, the expert has claimed that the syscall msgsnd() is already used for multiple public exploits since for heap spraying the syscall msgsnd() is a well-known primitive, and not only that even it also uses the “GFP_KERNEL_ACCOUNT.”

Apart from this, Andy also noted that in parallel to his own research of March 2021, one of the security researchers, Alexander Popov also traversed a similar structure in Four Bytes of Power that exploited the flaw “CVE-2021-26708” in the Linux kernel.

Using the msgget() an attacker can easily initiate many message queues, later an attacker can create a single message of the size of the total message queues and send them using msgsnd() for each of the message queues, that is known as primary message.

Now an attacker can follow the struct msg_msg header and spray a lot of messages with the help of unix sockets. An attacker can easily re-craft the fake struct msg_msg after knowing the address of a primary message.

While by reading more than DATALEN_MSG bytes the primary message content could be leaked, and here, from the primary message the leaked mlist.next pointer exposes the secondary message.

Escalating Privileges

In order to trigger the release that will kick off the JOP chain the final stage of the exploit have to close all the pipes. And in order to execute a kernel ROP chain, quickly achieving a kernel stack pivot is necessary, since, finding JOP gadgets is quite hard.

Kernel ROP chain: In this chain, later to resume the execution process at some scratchpad address in kernel Andy saved the value of RBP. And here to install kernel credentials, he summoned commit_creds(prepare_kernel_cred(NULL)) and later to switch the namespace of process 1 to the one of the init process summoned switch_task_namespaces(find_task_by_vpid(1), init_nsproxy).

Escaping the container and popping a root shell: In this case, to change mnt, pid, and net namespaces to leave the container and crumble out of the kubernetes pod an attacker will have the root permissions.

You can follow us on Linkedin, Twitter, Facebook for daily Cybersecurity and hacking news updates.

Balaji
Balaji
BALAJI is an Ex-Security Researcher (Threat Research Labs) at Comodo Cybersecurity. Editor-in-Chief & Co-Founder - Cyber Security News & GBHackers On Security.

Latest articles

LightSpy iOS Malware Enhanced with 28 New Destructive Plugins

The LightSpy threat actor exploited publicly available vulnerabilities and jailbreak kits to compromise iOS...

ATPC Cyber Forum to Focus on Next Generation Cybersecurity and Artificial Intelligence Issues

White House National Cyber Director, CEOs, Key Financial Services Companies, Congressional and Executive Branch...

New PySilon RAT Abusing Discord Platform to Maintain Persistence

Cybersecurity experts have identified a new Remote Access Trojan (RAT) named PySilon. This Trojan...

Konni APT Hackers Attacking Organizations with New Spear-Phishing Tactics

The notorious Konni Advanced Persistent Threat (APT) group has intensified its cyber assault on...

Free Webinar

Protect Websites & APIs from Malware Attack

Malware targeting customer-facing websites and API applications poses significant risks, including compliance violations, defacements, and even blacklisting.

Join us for an insightful webinar featuring Vivek Gopalan, VP of Products at Indusface, as he shares effective strategies for safeguarding websites and APIs against malware.

Discussion points

Scan DOM, internal links, and JavaScript libraries for hidden malware.
Detect website defacements in real time.
Protect your brand by monitoring for potential blacklisting.
Prevent malware from infiltrating your server and cloud infrastructure.

More like this

LightSpy iOS Malware Enhanced with 28 New Destructive Plugins

The LightSpy threat actor exploited publicly available vulnerabilities and jailbreak kits to compromise iOS...

New PySilon RAT Abusing Discord Platform to Maintain Persistence

Cybersecurity experts have identified a new Remote Access Trojan (RAT) named PySilon. This Trojan...

Konni APT Hackers Attacking Organizations with New Spear-Phishing Tactics

The notorious Konni Advanced Persistent Threat (APT) group has intensified its cyber assault on...