Join our Newsletter — 33% off our NHI Course
Home› Guides› D3-FCDC File Content Decompression Checking: Bounding and Testing…
Guide Endpoint Security

D3-FCDC File Content Decompression Checking: Bounding and Testing Compressed Content Safely

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 12 November 2026 11 min read
On this page

Compressed and encoded sections are where file parsers do their most complex work, so a file that claims to hold valid compressed data but does not, or that expands far beyond its size, is both a malformation signal and a denial of service risk. MITRE D3FEND names this countermeasure File Content Decompression Checking (D3-FCDC) and defines it as "Checking if compressed or encoded data sections can be successfully decompressed or decoded", adding that this can be followed by further analysis with semantic knowledge. It sits under the Isolate tactic as a child of File Format Verification (D3-FFV), which is itself under Content Validation. D3FEND's description is brief: some formats, such as JPEG, include encoded or compressed sections, and the technique verifies that those sections are present and decode correctly according to the specification. This card turns that into practice for upload pipelines, mail and file gateways and scanning engines, and covers how to verify the checks and where they fall short. The wider family is covered in D3-FFV File Format Verification and D3-CV Content Validation.

Key takeaways

  • Two questions, not one. Does the compressed or encoded section decode cleanly, and does it decode within agreed size, count, depth and time limits? D3FEND defines the first; the second is what keeps the check itself safe.
  • Check before you trust declared sizes. OWASP ASVS 5.0 requirement V5.2.3 asks applications to check compressed files against a maximum uncompressed size and a maximum number of files before uncompressing them, but header values can lie, so enforce the limits during decompression as well.
  • The decoder is attack surface. The NCSC import pattern warns about malformed compressed content that targets decompression code, so run decoding in a constrained, up-to-date component.
  • A clean decode is not a clean file. A valid archive can hold malicious members; FCDC proves structure, not intent, and must be followed by content analysis.
  • Limit hits are events. A file that exceeds a decompression limit or fails to decode should be blocked or quarantined and logged, not silently passed through unscanned.

D3-FCDC at a glance

AttributeValue
D3FEND IDD3-FCDC (d3f:FileContentDecompressionChecking)
TacticIsolate
Parent techniqueFile Format Verification (D3-FFV), under Content Validation (D3-CV) and Content Filtering (D3-CF)
Digital artefactFile Content Block Data, "the actual content or main data within a file or data block" (D3FEND relation: analyzes)
Typical targetsArchives (ZIP, gzip, 7z, RAR), Office Open XML and OpenDocument files (ZIP containers), PDF streams, compressed image data such as JPEG and PNG
D3FEND referencesGarfinkel, "Carving Contiguous and Fragmented Files with Fast Object Validation" (Digital Investigation, 2007); van den Bos, "Gathering Evidence: Model-Driven Software Engineering in Automated Digital Forensics"
Main limitationProves decodability, not safety; a well-formed file can still be malicious

How it works

Both D3FEND references come from digital forensics, where the question is whether a run of bytes is a real, intact file. Garfinkel's paper describes validators that run cheap checks first (header and footer bytes), then container structure checks, then decompression. Its JPEG validator decodes the Huffman-coded image data, and its ZIP validator checks the central directory records and then tests the compressed data. The same staged logic applies to security filtering:

  1. Locate the compressed or encoded sections the format specification says must exist: archive members, PDF object streams, image scan data.
  2. Read declared sizes (compressed and uncompressed size per member, member count) and reject anything over policy before decoding.
  3. Decode under limits: stop when output bytes, member count, nesting depth or elapsed time cross a threshold, whatever the header claimed.
  4. Treat decode errors as findings: CRC failures, truncated streams and invalid symbols mean the file is corrupt or crafted.
  5. Pass the decoded content on for semantic analysis, the "further analysis with semantic knowledge" in D3FEND's definition, such as malware scanning or D3-FCOA File Content Analysis.

The resource side is a recognised weakness class: CWE-409, Improper Handling of Highly Compressed Data (Data Amplification), describes a product that does not handle compressed input "with a very high compression ratio that produces a large output". The NCSC Safely Importing Data pattern adds that nested content should be unpacked and verified at each level and that "limits should be placed on the amount of nesting and recursion allowed".

ATT&CK techniques D3FEND relates to D3-FCDC

Relationship type: inferred only. D3FEND has no direct ATT&CK mapping for D3-FCDC. Its page shows a long "inferred, experimental" list derived through the File artefact family it shares with Content Validation (D3FEND 1.6.0, checked November 2026). Because the inference is that broad, the list says more about files in general than about decompression; the summary below groups it, and the full table is on the D3-CV Content Validation card. Each ID was checked against ATT&CK v20.

ATT&CK tactic (v20)Examples from the D3FEND list
Initial Access and ExecutionT1566.001 Spearphishing Attachment, T1566.002, T1566.003; T1204.002 Malicious File; T1127.001 MSBuild
Persistence and Privilege EscalationT1546 and T1547 sub-techniques, T1037.001 to T1037.004, T1543.001, .002, .004, T1137.001, T1137.003, T1505.003 Web Shell, T1548.002, T1548.003
StealthT1027.001 Binary Padding, T1027.002 Software Packing, T1027.004 Compile After Delivery; T1036.001, .003, .005, .006; T1564.002, .003, .006, .007; T1055 and T1574 sub-techniques; T1218.005, T1218.011; T1070.004 File Deletion
Defense ImpairmentT1556.002, T1556.003; T1647 Plist File Modification; T1685.006 Clear Linux or Mac System Logs; T1690 Prevent Command History Logging
Credential Access, Collection, C2, Exfiltration, ImpactT1003.007, T1003.008, T1552.001, T1552.003, T1555.003; T1074.001, T1114.001, T1560.001 to T1560.003; T1071.001, T1573.002; T1048.002; T1565.001, T1565.003

D3FEND still lists some IDs that ATT&CK v20 has revoked; the table shows the successors: Plist Modification is now T1647, DLL Side-Loading is folded into T1574.001, Clear Linux or Mac System Logs is now T1685.006, and Impair Command History Logging is now T1690. D3FEND also lists Launchd, which ATT&CK v20 marks deprecated with no successor, so it is left out.

Where decompression checking genuinely bites (NHI Mgmt Group view): malicious attachments and uploads delivered inside archives (T1566.001, T1204.002), where a malformed or oversized archive is either a scanner evasion attempt or a resource attack, and archived collected data (T1560) that a data loss control must be able to open to inspect. See the T1027 Obfuscated Files or Information Defensive Guide.

Where it is implemented

PlacementWhat it checksExample controls
Web application upload handlersArchive and document containers before extractionOWASP ASVS V5.2.3 size and file count limits; V5.2.5 reject symlinks in archives; V5.3.3 ignore user-supplied paths during decompression (zip slip). See the Secure File Upload Handling Guide
Language and library codeSafe extraction behaviourPython's zipfile documentation lists decompression bombs, CRC and format failures as extraction pitfalls and warns "Never extract archives from untrusted sources without prior inspection"; its zipfile.Path class does not sanitise member names, so the caller must
Malware scanning enginesRecursive unpacking with limits and alertsClamAV's clamd.conf limits: MaxScanSize (default 400M), MaxFileSize (default 100M), MaxRecursion (default 17, maximum 100), MaxFiles (default 10000), MaxScanTime (default 120000 ms), with AlertExceedsMax to flag files over the limits and AlertBrokenMedia and AlertEncrypted heuristics
Mail and file transfer gateways, cross-domain solutionsNested attachments before deliveryNCSC pattern: unpack, transform where needed, verify, with nesting limits and alerts on verification errors
Content disarm and reconstructionRebuilds content after decodingSee Content Disarm and Reconstruction

Defaults above are as stated in the ClamAV clamd.conf.sample file, checked November 2026. The limit names and defaults are product specific; the principle, a budget for bytes, files, depth and time, applies to any engine.

Implementation steps

  1. Inventory every place untrusted compressed content is opened: upload endpoints, mail gateways, file transfer, document preview, search indexing and backup ingest. Each is a decompression point.
  2. Set a budget per point. Maximum uncompressed size, member count, nesting depth and decode time, written into the upload or gateway specification (ASVS V5.1.1 asks for documented maximum size "including unpacked size").
  3. Enforce during decoding, counting real output bytes rather than trusting header sizes, and stop at the first limit hit.
  4. Decide the failure action. Fail closed: block or quarantine files that fail to decode or exceed limits, and turn on alerting for limit hits (for ClamAV, AlertExceedsMax) so they are not silently passed unscanned.
  5. Isolate the decoder. Run decompression in a separate, low-privilege process or container with memory and disk quotas, kept patched.
  6. Pilot in log-only mode. Record limit hits and decode errors for two to four weeks to size the budgets against real business files before blocking.
  7. Roll back by budget, not by switch. If a limit blocks legitimate files, raise that one limit for that one path; do not disable the check.

How to verify it works

  • Test corpus: keep a small, harmless test set: a truncated archive, an archive with a bad CRC, an archive nested beyond your depth limit, an archive with more members than allowed, and a highly compressed file that expands past the size budget. Each must be rejected or quarantined with the right reason.
  • Header lie test: include an archive whose declared uncompressed size is small but whose real output is large; this proves limits are enforced on output, not on headers.
  • Path test: include members with absolute paths or ".." components and confirm nothing is written outside the target directory.
  • Resource watch: during tests, confirm memory, disk and CPU on the decoding host stay within quota and that no worker hangs.
MetricExample target (NHI Mgmt Group suggestion, not a standard)Why it matters
Decompression points with a documented budget100% of inventoried pointsUndocumented points have no limits
Test corpus files correctly rejected100% on every releaseProves the limits and failure action work
Limit hits passed through unscannedZeroSilent pass-through is the main evasion path
Decoder worker crashes or timeouts per monthTracked, each investigatedCrashes can mean a decoder vulnerability is being probed

Limits, bypasses and failure patterns

  • Trusting the header: checking the declared uncompressed size and then decoding without a running byte count lets a crafted archive exceed the budget.
  • Fail open on limits: scanners that stop at a limit and report the file as clean let attackers pad or nest payloads past the limit. Alert on limit hits.
  • Checking the outer layer only: nested archives and documents inside archives need the same checks at each level, as the NCSC pattern describes.
  • Encrypted archives: a password-protected archive cannot be decoded by the gateway at all. Decide a policy (block, quarantine, or hold for release) and record it.
  • Decoder vulnerabilities: the check runs the code attackers target. An unpatched or unsandboxed decoder turns the control into the entry point.
  • Taking success as safety: a cleanly decoded archive can still contain a malicious executable or macro; FCDC must be followed by scanning or disarm.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev 5SI-10 Information Input ValidationChecking the validity of information inputs, here compressed sections
NIST SP 800-53 Rev 5SI-3 Malicious Code Protection, SC-5 Denial-of-service ProtectionScanning decoded content; limiting the effect of amplification
OWASP ASVS 5.0V5.1.1, V5.2.3, V5.2.5, V5.3.3Documented unpacked size limits, pre-decompression checks, symlinks, zip slip
MITRE CWECWE-409Improper Handling of Highly Compressed Data (Data Amplification)
MITRE D3FENDD3-CV, D3-FFV, D3-FCDCGrandparent, parent and technique

Practitioner checklist

  • List every point where untrusted compressed content is decoded.
  • Document a size, file count, depth and time budget for each point.
  • Enforce limits on real output bytes, not declared header sizes.
  • Fail closed and alert on decode errors and limit hits.
  • Reject absolute paths, ".." components and symlinks in archive members.
  • Run decoders in a patched, low-privilege, resource-limited process.
  • Set and record a policy for encrypted archives.
  • Run the test corpus on every release of the pipeline.

Standards and references

Related NHI Mgmt Group resources: D3-FFV File Format Verification · D3-CV Content Validation · Secure File Upload Handling Guide · File Upload Security Guide · MITRE D3FEND Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 12 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org