vBulletin Password Handling

Collapse
X
Collapse
  •  

  • vBulletin Password Handling

    Click image for larger version

Name:	password.png
Views:	598
Size:	189.5 KB
ID:	4482106

    Note: vBulletin Cloud sites cannot use custom password schemes at this time.

    The core security of your site is the User Password and how it is stored. In the beginning, vBulletin used a simple MD5 hash to represent the password. However as Floating Point Processors (i.e. GPU and ASICs) have become more powerful, this method proved to be risky and reduced security. If we significantly changed the password scheme, then users wouldn't be able to login and would need to change their passwords first. We needed a solution that was more convenient. At this point, a 3 character randomly generated salt was added to the password and it was hashed a second time. Again, technology caught up to this technique. So the salt was increased to 30 characters. Once again, technology caught up with the technique. We needed a better way to hash passwords but allow users to log in seamlessly.

    When PHP 5.5 was released, a new set of password hashing functions were released to help with these issues. So they were implemented into vBulletin. A new password system was developed in vBulletin 5 that uses Password Schemes. You can have multiple schemes active at a time and the system will determine which one is needed to verify the login password. Currently vBulletin 5.4.X ships with two password schemes. Both have their pros and cons. The new password functionality provides two things for vBulletin. The first is that is can generate a new salt every time a user password is created. These salts use cryptographic random numbers so they are more complex than the method used previously. The second is that comparing passwords can now take additional time. One of the common techniques to break hashed passwords is the amount of time it takes to create a comparable hash. Using the argon2id and blowfish algorithm, we can slow the password hashing down so it takes roughly half a second to complete. This helps to negate additional power added with hardware.

    Password Schemes

    vBulletin handles password hashing using PHP's password_hash() and password_verify() functions. This allows the system to utilize different password schemes across your userbase.

    Argon 2ID

    Currently, this is the default password scheme used by vBulletin. It has the highest priority at the moment and is considered to be cryptographically secure.

    Blowfish

    This password scheme is used as a secure fallback if your server does not support Argon 2ID. There are two schemes defined with this hashing method. The higher priority scheme takes more time to create a hash.

    Legacy

    This system allows your users to continue to log in with the password hashes generated in vBulletin 3 and vBulletin 4. This is its only purpose today. We do not recommend that you use it for new users.

    Password Compatibility

    vBulletin Passwords are stored in a manner that tells the software which scheme was used without actually knowing the password. This allows the system to verify any password as long as there is a valid scheme for it. Once the password is verified, it will be saved with the scheme that has the highest priority in your Password Schemes file.

    Adding New Schemes

    The password system in vBulletin 5 Connect is extendible so you can add your own password schemes. This is controled by the /core/includes/xml/pwsschemes_vbulletin.xml file and corresponding code found in /core/vb/utility/password/algorithm. Each new scheme added to the system needs an entry in a password schemes XML file and a corresponding class within the algorithm folder.

    Default pwschemes_vbulletin.xml

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <schemes>
    <scheme name='blowfish:10' priority='10' />
    <scheme name='legacy' priority='1' />
    </schemes>
    

    New Scheme Example

    You can add a new Blowfish/bcrypt scheme with a higher cost so that passwords take longer to hash and verify. This will make the passwords a bit more secure with newer hardware. Since we already have the code needed for the Blowfish scheme to work, we do not need to add any additional code to the system.

    This is a two step process.

    Edit the Password Scheme File

    To add our new simple scheme we need to create our own custom Password Scheme file. Let's add a new level of Blowfish hashing with a higher cost. In the /core/inclues/xml directory add a new file called pwsschemes_custom.xml. Add the following code to this file:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <schemes>
    <scheme name='blowfish:15' priority='20' />
    </schemes>
    

    Our new scheme uses the existing password hashing functions but we have increased the cost and the priority. To add this new scheme, we simply have to upload our file to /core/includes/xml. The custom name will ensure it doesn't get overwritten when vBulletin is upgraded to the next version. If we were adding a new type of Password hashing, we would have to provide the corresponding PHP classes to handle this. You can see how this is done by reviewing the classes in the /core/vb/utility/password directory.

    Rebuild Password Schemes

    Once the new file is uploaded to the server, you will need to rebuild the password schemes stored in the database. To do this, we will upload the /core/install directory to the server along tools.php. You can find tools.php in the do_not_upload directory in your download package. Place this file in /core/installs for the current task.

    Once these files are uploaded, point your browser to /core/install/tools.php. If you're asked for your Customer ID, enter it. Once the file has loaded in your browser choose the Rebuild Password Schemes option from the menu. When you're done, delete the /core/install directory from your site.

    Now you should be able to login normally and your password will be stored in the new scheme.

    Note: When changing vBulletin files, make sure not to overwrite or delete this file. Doing so will prevent logins to the site.

    Last edited by Wayne Luke; Thu 15 Jun '23, 7:40am.
      Posting comments is disabled.

    About the Author

    Collapse

    Wayne Luke A curious juxtaposition of nature, technology and sustainability. Find out more about Wayne Luke

    Article Tags

    Collapse

    administration (1) beginner (3) calendar (1) cloud (1) Custom (1) database (2) Google (1) how-to (2) howto (1) how to (1) https (1) Intermediate (4) MYSQL (2) performance (2) recovery tools (1) security (2) seo (1) server information (1) sftp (1) ssl (1) style (1) tls (1) tutorial (4) vb5howto (5) vbcloud (1)

    Latest Articles

    Collapse

    • Understanding MySQL's Table Status Output
      by Wayne Luke

      AdminCP → Maintenance → Diagnostics → System Information MySQL's SHOW TABLE STATUS command helps gather information about tables in a database. When executed, it provides a detailed overview of various metrics related to each table in the database. This information can be valuable for database administrators and developers to optimize performance, troubleshoot issues, and better understand their databases' structure. Let's delve into the output of MySQL's SHOW TABLE STATUS command and underst...

      Thu 22 Feb '24, 10:13am
    • vbevent.php
      by Wayne Luke
      (vBulletin 6+) This script will handle running the vbulletin offline events (Such as sending notifications for a post). This avoids having users trigger AJAX calls when hitting the site. It also avoids the problem where the background tasks fail to run because there is not enough traffic to trigger all of the scripts in a timely fashion. To use do the following: Copy the script from the do_not_upload directory of your vBulletin files to your web server. Preferably outside of the web root directory. S...
      Mon 8 Jan '24, 10:28am
    • vbcron.php
      by Wayne Luke

      This script will handle running the vbulletin schedule tasks (see the Scheduled Tasks menu in the Admincp). This avoids having users trigger ajax calls when hitting the site. It also avoids the problem where the scheduled tasks fail to run because there is not enough site traffic to trigger all of the scripts in a timely fashion.

      To use do it the following

      1. You will find this script in your do_not_upload directory. Copy the script to your web server. Preferably outside of the w...
      Mon 8 Jan '24, 10:24am
    • Common Mime Types
      by Wayne Luke
      vBulletin allows the upload of file attachments. Servers and browsers generally recognize the type of file using two methods; file extensions and MIME types. This document is to allow you to match extensions with MIME types so they are properly handled by browsers. table {width: 80%; margin-left:auto; margin-right:auto} table td:first-child { text-align:center} tr:nth-child(even) {background: #CCC} tr:nth-child(odd) {background: #FFF} th{ color: white; background: black; }​​ Media Images ...
      Tue 21 Nov '23, 10:30am
    • vBulletin Cookies
      by Wayne Luke
      vBulletin creates a number of cookies for functional purposes in the software. These default cookies do not track the user or report to a third-party. User Data Cookies These cookies track logged in users. They last for the session unless the user selects "Remember Me" on log in. It "Remember Me" is checked, the cookies will last for at least a year and are refreshed with every visit to the site. userid: Userid of Logged in User. password: hash of the user's password. sessionhash: Tracks the curre...
      Fri 19 Nov '21, 3:24pm
    • vBulletin Password Handling
      by Wayne Luke
      ​ Note: vBulletin Cloud sites cannot use custom password schemes at this time. The core security of your site is the User Password and how it is stored. In the beginning, vBulletin used a simple MD5 hash to represent the password. However as Floating Point Processors (i.e. GPU and ASICs) have become more powerful, this method proved to be risky and reduced security. If we significantly changed the password scheme, then users wouldn't be able to login and would need to change their passwor...
      Sat 27 Oct '18, 12:34pm
    Working...