Bug 803131 - samba with ldap backend: any authorized ldap user can open the home folder of the system user (passwd)
Summary: samba with ldap backend: any authorized ldap user can open the home folder of...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: samba
Version: 5.8
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Guenther Deschner
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-14 02:36 UTC by Andrey
Modified: 2012-03-15 00:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-14 14:48:13 UTC
Target Upstream Version:


Attachments (Terms of Use)
open [avahi] share (24.77 KB, image/png)
2012-03-14 02:36 UTC, Andrey
no flags Details
samba logs (115.62 KB, application/x-gzip)
2012-03-14 02:40 UTC, Andrey
no flags Details

Description Andrey 2012-03-14 02:36:20 UTC
Created attachment 569846 [details]
open [avahi] share

Description of problem:

necessary conditions for this error:

1. configured ldap server
2. /etc/nsswitch.conf
passwd: files ldap
shadow: files ldap
group: files ldap

3. getent passwd
should show a list of users from the passwd and ldap

4. smb.conf
    security = user

    passdb backend = ldapsam:ldap://ldap.local [^]
    ldap suffix = dc=dc,dc=local
    ldap admin dn = cn=login,dc=dc,dc=local
    ldap user suffix = ou=users
    ldap group suffix = ou=group

[homes]
    read only = no
    browseable = no
    profile acls = no
    inherit acls = yes
    inherit owner = yes
    csc policy = disable
    hide dot files = yes
    hide files = /.*/desktop.ini/

5. as a result, any authorized ldap user can open the home folder of the system user.
example: \\server\avahi see a screenshot.

all logs as an attachment. 
Version-Release number of selected component (if applicable):
samba-3.0.33-3.38.el5_8
kernel-2.6.18-308.1.1.el5
glibc-2.5-81

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Andrey 2012-03-14 02:40:06 UTC
Created attachment 569847 [details]
samba logs

added: samba logs (level 9)

Comment 2 Andrey 2012-03-14 02:50:12 UTC
also need store ldap password with command smbpasswd -w

Comment 3 Guenther Deschner 2012-03-14 14:48:13 UTC
Hi Andrey,

what you are seeing is in fact not a bug.

If you want to secure access to shares created via the [homes] mechanism, please follow the instructions from the Samba Howto Collection:
"Why Can Users Access Other Users' Home Directories?" (https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/securing-samba.html#id2619170).

In short: you can restrict access to only the authenticated user by setting "valid users = %S" in the [homes] section. You will also find this setting in our default smb.conf file that we ship with the samba package.

Comment 4 Andrey 2012-03-15 00:02:56 UTC
I'm sorry.
You do not understand all the charm of this bug.

The system user avahi (and many others) does not have a password.
# grep avahi /etc/passwd
avahi:x:70:70:Avahi daemon:/:/sbin/nologin

Authorized ldap user can open the home folder of the system
user. Without requiring a password!

passdb backend = ldapsam
This parameter indicates that it is necessary to verify users via LDAP.
Why is a check through the /etc/passwd?

LDAP directory includes more than 100 user accounts. Almost all corporate systems use it.

Where is the documentation that indicated the fact that any authorized LDAP user can easily access directly to the entire server's filesystem?

You know that a domain administrator and the server administrator, it is the different roles?

So, using this bug, a domain administrator has full access to the entire server's filesystem.


[homes]
    read only = no
    browseable = no
    invalid users = root,bin,daemon,adm,lp,sync,shutdown,avahi, and more others..

So it's not working!!! Any authorized LDAP user can open \\server\avahi


Note You need to log in before you can comment on or make changes to this bug.