Ferritaas Incident Intelligence
Defect Intelligence Report Bug 0868102 Severity: Medium (P3)

Antivirus File Buffer Exhaustion Dropping Multi-Gigabit ISO & Archive Downloads

Multi-gigabyte ISO images, software updates, and large compressed archives stall and fail around 10MB to 50MB with gateway timeouts when inspected by Antivirus profiles due to scanunitd buffer threshold lockups.

Technical Root Cause Analysis

The FortiOS Antivirus subsystem operates in tandem with the scanunitd daemon and the av_unpack decompression library. When an HTTP/HTTPS stream is routed through a security policy with an Antivirus profile, incoming file segments are queued in an allocated memory buffer up to the configured oversize-file-threshold (by default 10MB on desktop units and 20MB on mid-range units).

In affected FortiOS 7.2 releases, when a large binary download (such as an Ubuntu ISO or Windows VHDX image) exceeded the scanning threshold, a synchronization race condition occurred between the user-space buffer deallocator and the TCP socket ring. Rather than releasing the inspection buffer and transitioning the TCP socket to uninspected stream pass-through, the worker held zero-window TCP advertisements towards the client. After 60 seconds of stalled socket ACK exchanges, the connection timed out, generating an HTTP 504 Gateway Timeout or an abrupt TCP RST packet.

[scanunitd_av_unpack] file_id=0x91a0c4 stream size reached 10485760 bytes [scanunitd_av_unpack] threshold OVERSIZE triggered (oversize-file-threshold=10MB) [scanunitd_av_unpack] failed to transition session 0x7fa8102 to streaming passthrough [scanunitd_av_unpack] error: socket ring buffer starvation, window size=0 [wad_http_stream] client timeout waiting for downstream chunk: dropping session session 0x7fa8102 closed: proto=6, src=10.10.30.22:51240, dst=185.125.190.39:443 (HTTP 504)

Affected Firmware & Blast Radius Matrix

FortiOS Branch Vulnerable Builds Confirmed Clean Build Status & Workaround
FortiOS 7.2 7.2.2 – 7.2.6 7.2.7+ Tune oversize threshold / Flow mode
FortiOS 7.4 7.4.0 – 7.4.1 7.4.2+ Resolved in stream scheduler refactor
FortiOS 7.0 Low Occurrence 7.0.12+ Clean Buffer tuning if present

Platform Impact: Desktop and mid-range FortiGate models (FG-40F, FG-60F, FG-80F, FG-100F, FG-200F) running proxy or flow antivirus inspection on high-speed internet links (>100 Mbps).

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

Execute these diagnostic commands to inspect scanunit buffer utilization and check active protocol options limits:

Diagnostic Commands

# 1. Inspect global firewall session statistics and socket drop counts
diagnose sys session stat

# 2. View active firewall protocol options thresholds for HTTP and FTP
show firewall profile-protocol-options

# 3. Check live status and active memory of the scanunit daemon
diagnose test application scanunit 1

# 4. View real-time antivirus inspection worker statistics
diagnose sys session filter dport 443
diagnose sys session stat | grep -i av

Remediation & Workaround Steps (Teaser Preview)

Allow reliable multi-gigabyte ISO and archive downloads while maintaining real-time antivirus defense:

Step 02: Reconfigure HTTP Oversize Handling Action

Configure profile-protocol-options to permit oversized files without holding memory buffers.

🔒 Interactive CLI Available in Ferrite Runbook #05

Step 03: Switch Critical Data Policies to Flow-Based Antivirus

Utilize CP9/SP5 content processor flow-mode scanning to eliminate user-space file buffering.

🔒 Interactive CLI Available in Ferrite Runbook #05

Step 04: Whitelist Trusted Software Repositories via Web Filter

Exempt trusted software distribution CDNs (Canonical, Red Hat, Microsoft) from antivirus scanning.

🔒 Interactive CLI Available in Ferrite Runbook #05
⚡ 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

Why do large file downloads stall at exactly 10MB or 20MB?

The default 'oversize-file-threshold' in firewall profile-protocol-options for HTTP is set to 10MB on desktop appliances and 20MB on mid-range models. In vulnerable firmware, when a streaming download crosses this threshold, the scanunitd worker fails to transition the socket back to direct pass-through, resulting in zero-window TCP freezes and socket timeout drops.

Does increasing the oversize threshold fix the issue?

Increasing the threshold merely defers the crash and increases RAM consumption on desktop models with 2GB/4GB RAM. The recommended production fix is configuring 'oversize-file-threshold' to an appropriate size while ensuring 'uncompressed-oversize-limit' allows seamless bypass, or upgrading to 7.2.7+ where stream transition locking was overhauled.

Does switching from proxy mode to flow mode resolve the drop?

Flow-based antivirus reduces socket buffering because files are inspected on the fly using CP9/SP5 content processors without holding the complete payload in user-space RAM, substantially improving multi-gigabyte ISO transfer reliability.