Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging in with an AD-user that has no corresponding user in the TeamPass database reveals ALL passwords for a limited period. #1530

Closed
mflage opened this issue Oct 4, 2016 · 5 comments

Comments

@mflage
Copy link

mflage commented Oct 4, 2016

Steps to reproduce

  1. Battle with LDAP integration setup (a hassle in itself to get working)
  2. Log in with a user that doesn't exist in the local TeamPass database
  3. View all passwords

Expected behaviour

The user shouldn't be allowed to log in at all, as it has no corresponding entry in the local TeamPass database.

Actual behaviour

Instead the user can view ALL passwords.

Server configuration

Operating system:
Debian Jessie 8.5

Web server:
Apache 2.4.10

Database:
MariaDB 5.5.47

PHP version:
5.6.22-0

Teampass version:
2.1.23

Updated from an older Teampass or fresh install:
Updated from older TeamPass version.

Client configuration

Browser:
Different

Operating system:
Generally Microsoft Windows

Logs

Web server error log

Insert your webserver log here

Firebug log (How to?)

Insert the Firebug log here
@nilsteampassnet
Copy link
Owner

Please update to 2.1.26

@Qutianer
Copy link

Same as #1153 ?

@jsandova
Copy link

This issue still exists with version 2.1.27.

@nilsteampassnet
Copy link
Owner

As I cannot test, can you please do the next change assuming you are using 2.1.27

Open file sources/identify.php, around line 545 found

        DB::insert(
            prefix_table('users'),
            array(
                'login' => $username,
                'pw' => $data['pw'],
                'email' => @$user_info_from_ad[0]['mail'][0],
                'name' => $user_info_from_ad[0]['givenname'][0],
                'lastname' => $user_info_from_ad[0]['sn'][0],
                'admin' => '0',
                'gestionnaire' => '0',
                'can_manage_all_users' => '0',
                'personal_folder' => $_SESSION['settings']['enable_pf_feature'] == "1" ? '1' : '0',
                'fonction_id' => '0',
                'groupes_interdits' => '0',
                'groupes_visibles' => '0',
                'last_pw_change' => time(),
                'user_language' => $_SESSION['settings']['default_language']
            )
        );

and replace by

        DB::insert(
            prefix_table('users'),
            array(
                'login' => $username,
                'pw' => $data['pw'],
                'email' => @$user_info_from_ad[0]['mail'][0],
                'name' => $user_info_from_ad[0]['givenname'][0],
                'lastname' => $user_info_from_ad[0]['sn'][0],
                'admin' => '0',
                'gestionnaire' => '0',
                'can_manage_all_users' => '0',
                'personal_folder' => $_SESSION['settings']['enable_pf_feature'] == "1" ? '1' : '0',
                'fonction_id' => '',
                'groupes_interdits' => '',
                'groupes_visibles' => '',
                'last_pw_change' => time(),
                'user_language' => $_SESSION['settings']['default_language'],
                'encrypted_psk' => ''
            )
        );

Note if you are in 2.1.26, then remove the last entry 'encrypted_psk' => ''

@mflage
Copy link
Author

mflage commented Jul 8, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants