This situation is potentially a little overblown.
A very specific subset of mods were problematic.
The real worry is that the malware can automatically spread itself into all the other .jar files on your device!
CurseForge have a disinfection guide here: https://support.curseforge.com/en/support/solutions/articles/9000228509-june-2023-infected-mods-detection-tool/
So I highly recommend you give that a check through if you've downloaded anything from CurseForge recently.