Ferritaas Incident Intelligence
PSIRT Advisory Intelligence CVE-2022-40684 FG-IR-22-377 Severity: Critical (CVSS 9.6)

CVE-2022-40684: Administrative Interface Auth Bypass via 'Forwarded' Header

An authentication bypass using an alternate path or channel [CWE-288] in FortiOS administrative web server and REST API allows unauthenticated remote attackers to perform unauthorized operations via forged HTTP Forwarded headers.

🚀 Open Full Runbook & Live Automation on Ferrite → Browse Known Issues Directory
🚨 Active In-The-Wild Exploitation · Mass Scanning Confirmed

Technical Root Cause Analysis

The FortiOS administrative interface daemon (/bin/httpsd) handles inbound HTTPS management requests and REST API calls. To facilitate communication between internal appliance processes (such as automated reporting workers and local proxy daemons), FortiOS implements an internal trust mechanism based on HTTP headers.

When processing HTTP requests, the daemon evaluates client headers including Forwarded, X-Forwarded-For, and User-Agent. If a request includes a spoofed header structure such as Forwarded: for="[127.0.0.1]:80";by="[127.0.0.1]:80" combined with a trusted internal client User-Agent (such as Report Runner), the authentication proxy logic erroneously flags the connection as trusted internal IPC traffic.

Because the internal proxy treats the request as already authenticated, subsequent administrative handlers process malicious requests directly, allowing threat actors to manipulate administrator accounts, exfiltrate full configuration backups, and append unauthorized SSH public keys to the root account.

# IOC Log Evidence: System event log showing unauthorized admin session from external IP date=2024-04-18 time=03:14:22 logid=0100032001 type=event subtype=system level=information vd="root" user="admin" ui="jsconsole" action="login" status="success" srcip=198.51.100.42 dstip=203.0.113.1 service="https" msg="Administrator admin logged in successfully from 198.51.100.42 via jsconsole using report-runner proxy token"

Affected Firmware & Blast Radius Matrix

FortiOS Branch Vulnerable Builds Confirmed Clean Build Status & Workaround
FortiOS 7.2 7.2.0 – 7.2.1 7.2.2+ Strip HTTPS on WAN; set trusthost
FortiOS 7.0 7.0.0 – 7.0.6 7.0.7+ Strip HTTPS on WAN; upgrade firmware
FortiProxy 7.2 7.2.0 7.2.1+ Apply management local-in filter
FortiProxy 7.0 7.0.0 – 7.0.6 7.0.7+ Upgrade to patched build
FortiOS 7.4 Not Affected 7.4.0+ Clean Proxy header trust logic deprecated

Platform Impact: Affects any FortiGate appliance running vulnerable firmware where HTTP or HTTPS administrative access is exposed to untrusted networks or WAN interfaces. FortiSwitchManager is also affected.

Step 01: Free Verification CLI (Safe Read-Only)

Execute these diagnostic commands via SSH or console to audit administrative access logs, inspect external interface bindings, and check admin lockout states:

Diagnostic Commands

# 1. Search recent system event logs for unauthorized admin logins and suspicious source IPs
execute log display | grep -E "user=\"admin\"|srcip="

# 2. Audit all network interfaces to detect public WAN interfaces exposing HTTP or HTTPS
show system interface | grep allowaccess

# 3. Check administrative lockout tables for brute-force or anomalous session locks
diagnose sys admin-lockout list

Remediation & Workaround Steps (Teaser Preview)

Follow the complete step-by-step remediation guide in the Ferrite interactive platform:

Step 02: Audit Existing Administrator Accounts & SSH Keys

Scan configuration for unauthorized admin accounts, newly created super-admin profiles, and injected SSH public keys.

🔒 Interactive CLI Available in Ferrite Runbook #11

Step 03: Immediate Interface Hardening (Strip HTTPS/HTTP)

Remove administrative management protocols from untrusted WAN interfaces with zero impact to transit traffic.

🔒 Interactive CLI Available in Ferrite Runbook #11

Step 04: Enforce Strict Administrator Trusthosts

Configure dedicated trusted subnet restrictions (trusthost) across all administrative accounts to block spoofed sessions.

🔒 Interactive CLI Available in Ferrite Runbook #11
⚡ Ferrite Platform Superpowers

Execute the Complete Runbook with Live Browser Automation

Connect your FortiGate via browser console (Web Serial) or local SSH bridge, verify each command in real-time, generate ready-to-run Tera Term scripts, and export sanitized TAC dossiers.

Live Browser Automation Direct terminal connection with live step checkoff.
📟
1-Click Tera Term (.ttl) Generate scripts for air-gapped jumpboxes.
🛡️
Zero-Trust Scrubber Scrub serials and credentials in local browser RAM.
📄
TAC P1 Escalation Dossier Standardized evidence export with SHA-256 seal.

Frequently Asked Questions

How does the CVE-2022-40684 authentication bypass work?

By providing spoofed 'Forwarded' HTTP headers (pointing to 127.0.0.1) and a 'Report Runner' User-Agent, attackers trick the internal HTTPS reverse proxy into authenticating requests as internal daemon processes.

What is the quickest non-disruptive workaround?

Disable HTTPS and HTTP administrative access on all public-facing interfaces and apply strict trusthost IP subnet limits under config system admin.

Which firmware releases contain the permanent patch?

FortiOS 7.2.2, 7.0.7, and all subsequent releases permanently remove trust in user-supplied Forwarded headers for administrative endpoints.