Skip to content
RCE Write-up Intermediate

Samba 3.5.0+ vulnerability: Remote code execution from a writable share

Samba versions from 3.5.0 onwards allow a malicious client to upload a shared library to a writable share and then cause the server to load and execute it, leading to remote code execution.

samba.org

Published on samba.org

All versions of Samba from 3.5.0 onwards are vulnerable to a remote code execution vulnerability, allowing a malicious client to upload a shared library to a writable share, and then cause the server to load and execute it.

The author, on samba.org

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server loads shared libraries from writable shares without proper validation, allowing an attacker to supply a malicious library.

Impact

A malicious client could execute arbitrary code on the server, potentially taking full control.

What the attacker needed

A writable Samba share; network access to the Samba server

The fix

The vulnerability was fixed in Samba 4.6.4, 4.5.10 and 4.4.14, and patches were made available; a workaround is to set 'nt pipe support = no' in smb.conf.

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 write-up has not been written yet. The Original tab links to the source.

Samba is software that lets Linux computers share files with Windows machines. A writable share is a folder that users can upload files to. The bug lets an attacker put a special file (a shared library) into that folder and trick the server into running it, which gives the attacker control over the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.