Minecraft Forge should be completely safe if you downloaded it from the official website. I would check how much people downloaded it and if it is much people, then it have 95% safety chance if you don't use the official forge website.
Forge is safe (obviously others have linked the official site above so I don't need to repost it), even other modloaders are safe (Liteloader, Rift, Fabric), just be careful of any sites that host Forge or mods, if you don't know of safe sites check this list of mod repost sites (first link below) out to know which to avoid as many are at the top of the search results, or YouTube videos that 'when I was supporting Rift modloader only as Forge 1.13 hadn't come out yet people did Forge 1.13 install videos that showed 1.12.2 but weren't really giving people bad redirects just were giving false information' from memory they were annoying to me as the one that had a wiki (Rift Forum Thread in signature below)/full focus on the legit stuff and these people just do videos for views based on people that were Forge 1.13 excited at the time.
Check out so you don't download mods that are stolen, get hacked/pirate launchers or malware/viruses:
That or just go to Curseforge or PlanetMinecraft, (depends on the creator with PlanetMinecraft as some do ad site redirects but I feel that's lessened over the years) as they monitor and have teams to cover the content before it ends up on the platform so you know it's safe and for the version it's intended for of the game.
If it said virus detected that makes it seem like your antivirus detected a known virus, not just “running this program could potentially lead to malware”. I would try doing further research about what the message means with your antivirus just to make sure.
Oh, and don’t ever go to minecraftdl, I myself got malware from that site that posed as a mod + adventure map installer.