Keeping your software up to date is crucial for security and performance. If you’re using FreeIPA and running old jQuery version, it’s time to upgrade. I am using jQuery version 3.4.1 and this version is outdated and vulnerable to known issues, specifically:

  • CVE-2020-11022
  • CVE-2020-11023
  • CVE-2020-23064

It is a good practice to stay updated to protect against potential threats. In this tutorial, I’ll guide you through upgrading jQuery from version 3.4.1 to version 3.7.1. You can opt for a newer version if available, but as of the time of writing this, 3.7.1 is a new version.

Prerequisites

Before proceeding with the upgrade, ensure you have administrative access to the FreeIPA server. It’s also recommended to create a backup of your current jQuery file to prevent any disruption in case something goes wrong.

Step 1: Navigate to the jQuery Directory

First, access the folder where the old jquery.js file is located. You can do this by running the following command:

  cd /usr/share/ipa/ui/js/libs
  

Step 2: Backup the Existing jQuery File

Create a backup of the old jquery.js file. This ensures you can restore it if needed.

  mv jquery.js jquery.js.BAK
  

Step 3: Download the New jQuery Version

Next, download the latest version of jQuery and rename it to replace the old file. You need to be in this path /usr/share/ipa/ui/js/libs:

  wget https://code.jquery.com/jquery-3.7.1.js && mv jquery-3.7.1.js jquery.js
  

Step 4: Restart the IPA Service

After replacing the jQuery file, restart the IPA service to apply the changes.

  systemctl restart ipa
  

Step 5: Verify the Upgrade

Once you’ve completed the upgrade, you’ll want to ensure that jQuery is functioning correctly. Use the browser console to check if the new jQuery version was applied.

  • Go to your FreeIPA web UI and open the browser console there.
  • Run this command:
  console.log(jQuery.fn.jquery);
  
  • You will see now the current jQuery version in use.

Conclusion

By following these steps, you’ve successfully upgraded jQuery on your FreeIPA server, improving your application’s security and functionality. Always keep your libraries up to date to avoid vulnerabilities and enhance performance. If you have any questions or run into issues, feel free to ask for help!