Upgrade to the fixed release for your branch: 18.6.1, 18.5.3, 18.4.5.Vendor announcement
Self-managed only (GitLab.com is patched by GitLab). Follow the upgrade path: you may need intermediate versions.
Using distro packages? Distros backport fixes under their own version numbers. Check your distro's status for CVE-2024-9183 (and the other 5 CVEs):Debian · Ubuntu · Red Hat · Alpine