If you’re using the regular nix from nixpkgs (which the vast majority of users will be), you’re still on a safe version. If you recently (after August 1st) installed nix using the nix (not NixOS) installers, or are using nixVersions.git from nixpkgs, then you need to double-check. A fix is expected in version 2.24.6 which is to be released soon.
If you set nixVersions.git or nixVersions.nix_2_24 in your NixOS, Home Manager, or nix-darwin configuration, update your Nixpkgs pin and rebuild the system. Otherwise you don’t need to do anything.
Check when excluding 2.24.6 is available on the Nixpkgs channel branches:
Case-sensitivity was only one of the vectors. There are a class of similar bugs that abuse a similar mechanism of defining a symlink with an arbitrary target and then later traversing that symlink as a way to get write access as root. Other mechanisms include messing with the ordering of NAR entries and unicode representations.