Skip to content
Memory corruption Advisory Advanced CVE-2021-44142

(Pwn2Own) Samba fruit_pwrite Heap-based Buffer Overflow Remote Code Execution Vulnerability

A heap-based buffer overflow in Samba's fruit_pwrite function allows remote unauthenticated attackers to execute arbitrary code as root. The flaw arises from missing validation of user-supplied data length before copying into a fixed-size heap buffer.

Nguyễn Hoàng Thạch Follow

Originally disclosed on Zero Day Initiative

Critical 9.8 View original

This vulnerability allows remote attackers to execute arbitrary code on affected installations of Samba. Authentication is not required to exploit this vulnerability.

Nguyen Hoang Thach (https://twitter.com/hi_im_d4rkn3ss) and Billy Jheng Bing-Jhong (https://twitter.com/st424204), on the Zero Day Initiative

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the fruit_pwrite function fails to check the length of user-supplied data before copying it into a fixed-size heap buffer, leading to a heap overflow.

Impact

Remote attackers could execute arbitrary code with root privileges on affected Samba installations.

What the attacker needed

No authentication required; Network access to Samba service

The fix

Samba has issued an update to correct this vulnerability.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is a memory corruption bug in Samba, a file-sharing service. An attacker can send specially crafted data to overflow a buffer and run their own code on the server, without needing to log in. The code runs with the highest privileges (root), so the attacker could take full control of the machine.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Nguyễn Hoàng Thạch

View all

1 more disclosed report, best first.

More from Zero Day Initiative

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.