Blog:

De geschiedenis van 30 jaar cybersecurity

Lees verder

Pinewood Security Bulletin – Critical vulnerability in Fortinet FortiManager (CVE-2024-47575)

For English, see below.

Beschrijving

Fortinet heeft updates uitgebracht voor FortiManager waarmee het een ernstige kwetsbaarheid in dit product verhelpt. Via een kwetsbaarheid in de fgfmd daemon op deze devices kan een aanvaller op afstand en zonder authenticatie ongeautoriseerde code en commando’s uitvoeren. Op die manier kan deze bijvoorbeeld FortiManager-configuraties downloaden, waaronder de configuraties van FortiGate-devices die via deze FortiManager worden beheerd.

Om de kwetsbaarheid uit te kunnen buiten vanaf het internet moet de fgfmd daemon vanaf het internet bereikbaar zijn (in de regel via 541/tcp bij IPv4 en 542/tcp bij IPv6) en moet de aanvaller beschikken over een valide Fortinet-certificaat van een Fortinet-device of Fortinet-VM. De kwetsbaarheid lijkt al te zijn misbruikt door een onbekende actor.

Kwetsbare versies

De kwetsbaarheid is aanwezig in onderstaande versies van FortiManager:

  • FortiManager 7.6: versie 7.6.0
  • FortiManager 7.4: versie 7.4.4 en ouder
  • FortiManager 7.2: versie 7.2.7 en ouder
  • FortiManager 7.0: versie 7.0.12 en ouder
  • FortiManager 6.4: versie 6.4.14 en ouder
  • FortiManager 6.2: versie 6.2.12 en ouder

De kwetsbaarheid bevindt zich ook in identieke versies van FortiManager Cloud (m.u.v. versie 7.6).

Daarnaast geeft Fortinet aan dat ook oudere FortiAnalyzer-devices (1000E, 1000F, 2000E, 3000E, 3000F, 3000G, 3500E, 3500F, 3500G, 3700F, 3700G, 3900E) kwetsbaar zijn indien hierop de functie FortiManager on FortiAnalyzer is ingeschakeld via het commando set fmg-status enable.

Oplossingen en tijdelijke mitigaties

Fortinet heeft nieuwe versies van FortiManager uitgebracht om de beschreven kwetsbaarheid te verhelpen. Wij raden aan kwetsbare devices z.s.m. te upgraden naar één van onderstaande versies van FortiManager:

  • FortiManager 7.6: versie 7.6.1 of nieuwer
  • FortiManager 7.4: versie 7.4.5 of nieuwer
  • FortiManager 7.2: versie 7.2.8 of nieuwer
  • FortiManager 7.0: versie 7.0.13 of nieuwer
  • FortiManager 6.4: versie 6.4.15 of nieuwer
  • FortiManager 6.2: versie 6.2.13 of nieuwer

Als het niet mogelijk is om op korte termijn een upgrade uit te voeren, kan via een configuratiewijziging worden voorkomen dat onbekende devices zich registreren via de FortiManager. Maak hiervoor gebruik van een configuratie zoals hieronder:

config system global

    set fgfm-deny-unknown enable

end

Daarnaast kan ervoor gekozen worden om externe toegang tot de fgfmd daemon te blokkeren om de kans op misbruik van de kwetsbaarheid te verkleinen.

Detectie van mogelijk misbruik

Pinewood heeft actieve uitbuiting waargenomen van deze kwetsbaarheid rondom 22 en 23 september 2024. Het is dan ook van groot belang om te controleren of een FortiManager-device al via deze kwetsbaarheid is gecompromitteerd. Voer hiertoe de volgende controles uit op een FortiManager-device:

  • Controleer of onlangs een nieuw device is toegevoegd aan de configuratie. Dit is te herkennen aan de volgende entries die terug te vinden zijn in de FortiManager-logging:
    type=event,subtype=dvm,pri=information,desc=”Device,manager,generic,information,log”, user=”device,…”,msg=”Unregistered device localhost add succeeded” device=”localhost” adom=”FortiManager” session_id=0 operation=”Add device” performed_on=”localhost” changes=”Unregistered device localhost add succeeded

    type=event,subtype=dvm,pri=notice,desc=”Device,Manager,dvm,log,at,notice,level”, user=”System”,userfrom=””,msg=”” adom=”root” session_id=0 operation=”Modify device” performed_on=”localhost” changes=”Edited device settings (SN FMG-VMTM23017412
  • Controleer via de FortiManager WebGUI of hier onverwachte devices in terug te vinden zijn. Bij de nu bekende aanvallen zal een succesvolle aanval te herkennen zijn aan een nieuw FortiManager-device met IP 45.32.41[.]202 en serienummer FMG-VMTM23017412.
  • Controleer of er communicatie heeft plaatsgevonden tussen het FortiManager IP en één of meerdere van onderstaande IP-adressen:45.32.41[.]202
    45.32.63[.]2
    104.238.141[.]143
    158.247.199[.]37
  • Controleer of één van onderstaande bestanden aanwezig is op een device:/tmp/.tm
    /var/tmp/.tm

Incident response

Mocht uw FortiManager device onverhoopt gecompromitteerd zijn via deze aanval, dan raden wij in ieder geval aan om wachtwoorden en secrets in de configuratie van alle devices die via de FortiManager worden beheerd, aan te passen. Denk hierbij aan (deze lijst is niet volledig, dit kan namelijk per device verschillen):

  • VPN Pre-shared keys
  • Admin-, LDAP-, RADIUS-, FSSO-, FortiSwitch-, FortiAP- en HA-wachtwoorden,
  • CSF-sleutels,
  • Certificaten voor GUI, reverse proxy, SSL-inspectie IPS en IPSEC VPN, en
  • SSID Pre-Shared Keys

Let er daarbij op dat bij het gebruik van vertrouwde certificaten niet alleen een nieuw certificaat wordt aangemaakt, maar ook het oude certificaat wordt ingetrokken. Doe navraag bij de Certificate Authority (CA) die het certificaat het uitgegeven hoe dit gedaan kan worden en geef daarbij als reden keyCompromise op zodat de intrekking zeker verspreid wordt.

Het valt niet uit te sluiten valt dat het FortiManager-device via deze kwetsbaarheid volledig gecompromitteerd is. Daarom wordt geadviseerd om het besturingssysteem volledig opnieuw in te richten. Een configuratie backup kan veilig teruggezet worden in een nieuwe installatie. Hierbij moet nog steeds rekening gehouden moet met het advies om de wachtwoorden en secrets uit de configuratie te resetten. Dit kan zowel voor als na het terugzetten van de configuratie in een nieuwe installatie gedaan worden.

Meer informatie

Managed Security Services (MSS) klanten

Als u een Pinewood Managed Security Services contract heeft is er geen actie nodig. Pinewood neemt de benodigde maatregelen om uw omgeving te beschermen tegen deze kwetsbaarheden.

Vragen

Voor vragen over deze security bulletin kunt u contact opnemen met de Pinewood Servicedesk. De servicedesk is bereikbaar via +31 15 251 36 33 en via support@pinewood.nl.

===== ENGLISH =====

Description

Fortinet released updates to resolve a critical vulnerability in FortiManager. The vulnerability is in the fgfmd daemon on these devices and enables an attacker to remotely execute code and commands on the device without prior authentication. This way, an attacker can e.g. download FortiManager configurations such as the configurations of FortiGate appliances managed by the device.

To be able to exploit the vulnerability from the internet, the fgfmd daemon should be accessible to all (via 541/tcp or 542/tcp) and the attacker must possess a valid Fortinet certificate, extracted from a Fortinet device or VM. The vulnerability was already exploited by an unknown actor.

Vulnerable versions

The following versions of FortiManager are impacted by this vulnerability:

  • FortiManager 7.6: version 7.6.0
  • FortiManager 7.4: version 7.4.4 and below
  • FortiManager 7.2: version 7.2.7 and below
  • FortiManager 7.0: version 7.0.12 and below
  • FortiManager 6.4: version 6.4.14 and below
  • FortiManager 6.2: version 6.2.12 and below

 

The vulnerability also exists in cloud versions of FortiManager (except for version 7.6 installations).

In addition, Fortinet indicates that older FortiAnalyzer devices (1000E, 1000F, 2000E, 3000E, 3000F, 3000G, 3500E, 3500F, 3500G, 3700F, 3700G, 3900E) may also vulnerable if the function FortiManager on FortiAnalyzer is enabled via the command set fmg-status enable.

Solutions and workarounds

Fortinet released new versions of FortiManager to fix the vulnerability. We recommend upgrading a vulnerable FortiManager device ASAP to one of the FortiManager versions listed below:

  • FortiManager 7.6: version 7.6.1 or above
  • FortiManager 7.4: version 7.4.5 or above
  • FortiManager 7.2: version 7.2.8 or above
  • FortiManager 7.0: version 7.0.13 or above
  • FortiManager 6.4: version 6.4.15 or above
  • FortiManager 6.2: version 6.2.13 or above

If a vulnerable FortiManager device cannot be upgraded in the short term, a configuration change can be applied to the device to prevent unknown devices from registering:

config system global

    set fgfm-deny-unknown enable

end

Alternatively, connections to the fgfmd daemon from external IP addresses can be blocked to lower the risk of exploitation.

Detection of possible misuse

Pinewood has seen active exploitation of the described vulnerability around 22 and 23 September 2024. It is therefore of upmost importance to check if a vulnerable FortiManager device was already compromised through this vulnerability. To do so, execute the following checks on these devices:

  • Check if a new device was recently added to the configuration. The addition of a new device can be found in the FortiManager logging by looking for the following two events:

    type=event,subtype=dvm,pri=information,desc=”Device,manager,generic,information,log”, user=”device,…”,msg=”Unregistered device localhost add succeeded” device=”localhost” adom=”FortiManager” session_id=0 operation=”Add device” performed_on=”localhost” changes=”Unregistered device localhost add succeeded

    type=event,subtype=dvm,pri=notice,desc=”Device,Manager,dvm,log,at,notice,level”, user=”System”,userfrom=””,msg=”” adom=”root” session_id=0 operation=”Modify device” performed_on=”localhost” changes=”Edited device settings (SN FMG-VMTM23017412
  • Check if you can find unknown devices showing up in the FortiManager GUI. The attacks we’ve seen so far all depend on a new FortiManager device added to the configuration with IP 45.32.41[.]202 and serial number FMG-VMTM23017412.
  • Check if you can find any communication between the FortiManager IP and one or more of the IP addresses below:45.32.41[.]202
    45.32.63[.]2
    104.238.141[.]143
    158.247.199[.]37
  • Check if one of the following files exist on a device:/tmp/.tm
    /var/tmp/.tm

Incident Response

Should your FortiManager device be compromised through this attack, we recommend at the very least to change the passwords and secrets in the configuration of all devices managed by the FortiManager. Consider the following (this list is not exhaustive, as it may vary by device):

  • VPN Pre-shared keys
  • Admin, LDAP, RADIUS, FSSO, FortiSwitch, FortiAP, and HA passwords
  • CSF keys
  • Certificates for GUI, reverse proxy, SSL inspection IPS and IPSEC VPN, and
  • SSID Pre-Shared Keys

Note that when using trusted certificates, not only is a new certificate created, but the old certificate is revoked as well. Inquire with the Certificate Authority (CA) that issued the certificate on how this can be done and provide keyCompromise as the reason to make sure that the revocation is effectively disseminated.

It cannot be ruled out that the FortiManager device has been completely compromised via this vulnerability. It is therefore advised to completely reinstall the operating system. A configuration backup can be safely restored to a new installation. When restoring the configuration also consider the advice to reset passwords and secrets from the configuration. This can be done both before and after restoring the configuration in a new installation.

More information

Managed Security Services (MSS) customers

If you have a Pinewood Managed Security Services contract, no action is required. Pinewood takes the necessary measures to protect your environment from these vulnerabilities.

Questions

For questions about this security bulletin, please contact the Pinewood Service desk. The service desk can be contacted at +31 15 251 36 33 and via support@pinewood.nl.

Richard Strooper

CTO / Manager SOC

015 251 36 36

info@pinewood.nl