Today we have released versions 4.2.1, 4.1.2, 4.0.2 and 3.7.3 of Nominatim which fix a cross-site scripting issue in the API.
Updating is straightforward. Simply build and install the new version. If you are running a 4.1 installation, please check which patch version you are running. If you are on 4.1.99, then you need to update to 4.2.1 directly.