XLS Security and Privacy: Hidden Data to Check

November 08, 2026 · XLS.now Editorial · XLS Essentials

Review active content, parser risks and hidden metadata before opening or sharing XLS files.

Hidden Sheets, Charts, and Non-Standard Record Placement

XLS workbooks can conceal data in sheets that the Excel UI never exposes. The BOF record that opens each sheet substream contains a SheetState field at offset 0x0A from the record start. Valid values are 0x00 (visible), 0x01 (hidden), and 0x02 (very hidden). A very hidden sheet cannot be unhidden through the standard Format > Sheet > Unhide dialog—it requires VBA or direct binary manipulation. Attackers routinely place sensitive reference data, lookup tables, or pivot cache sources on very hidden sheets.

Charts present a separate concealment vector. The Chart record (0x100A) is not restricted to chart sheet substreams. It can appear inline within a worksheet’s record sequence, carrying full data series definitions. Each series may reference external workbooks through NumRef sub-records. A NumRef beginning with [1] or a higher bracketed integer points to an external file, potentially disclosing network paths or filenames from the author’s environment.

Verification steps

  • Walk every BOF record in the workbook stream. For each sheet-type BOF (type field 0x0010), read the byte at offset 0x0A. Flag any value of 0x02.
  • Extract all Chart records regardless of their location in the record sequence. Parse each NumRef sub-record and list any external reference tokens (bracketed integers followed by sheet-and-range strings).
  • Check for Feat records (0x0868) with a featType of 0x00000001. These enable Smart Tags, which can contain hardcoded URLs pointing to remote services that trigger on cell selection.

Active Content: Macro Tables, Excel 4.0 Opcodes, and Embedded Executables

XLS stores executable macro content differently from the VBA streams found in modern OOXML. The BOF record’s type field identifies macro sheets with the value 0x0040 (Excel 4.0 macro sheet). These sheets contain cells with formulas that are actually macro commands. The opcode 0x021F marks a string as an Excel 4.0 macro function. Strings reside in the Shared String Table (SST) or inline in LabelSst records. Macro sheets often carry obfuscated strings far longer than typical cell content—lengths exceeding 1,024 characters warrant immediate scrutiny.

Embedded objects add another execution layer. EmbeddedObject records and ObjectLink records can reference OLE2 class IDs tied to executable types. The class ID 00020900-0000-0000-C000-000000000046 identifies a Windows Metafile, which has been historically exploitable. OBJ records containing OLE_LINK1 or OLE_LINK2 identifiers may resolve to external binaries at load time.

Observable checks

  • Scan for BOF records with type equal to 0x0040. Count them separately from normal worksheets.
  • Search the SST for string entries longer than 1,024 characters. Hex-decode any that appear to contain repeated byte patterns or high-entropy sequences.
  • Locate OBJ records and examine the cch (character count) fields for OLE_LINK strings. Extract the associated class ID and cross-reference against known executable COM classes.

Parser Exploitation: Record Size Mismatches and Numeric Overflow

The XLS binary specification enforces a strict record sequence within each sheet substream. Malformed files test parser boundaries through several well-documented techniques. A BOF record without a matching EOF at the same nesting level can cause a parser to read past the intended stream boundary. Record headers declare a 2-byte size field; if that size exceeds the remaining bytes in the substream, a vulnerable parser may allocate memory based on the declared size and then under-read, leaving uninitialized heap data.

The RK record (0x027E) packs a 4-byte numeric value where bits 24–30 represent the exponent in IEEE 754 single-precision format. If all exponent bits are set to 1, the value represents either NaN or Infinity. Parsers that do not explicitly handle these IEEE special values may perform undefined conversions, leading to logic errors or crashes. The MulRK record (0x00BD) compounds this risk by packing multiple RK values into one record, indexed by row. An out-of-range row index can direct a parser to write decoded values outside allocated buffers.

Hard limits and validation

  • Count BOF/EOF pairs per substream. Reject any substream where the count is odd or where nesting levels do not return to zero.
  • For every RK record, mask bits 24–30. If the result equals 0x7F, flag the record as carrying a non-finite value.
  • Verify that the SST record’s cstlen field (total number of string entries) matches the actual count of string entries parsed from the SST stream. A discrepancy of even one entry indicates structural corruption or deliberate manipulation.

OLE2 Header Anomalies and Sector Chain Manipulation

The OLE2 header at file offset 0x0000 governs how all streams and storages are located. The MiniSectorCutoff field at offset 0x0038 defines the maximum size of a stream that will be stored in the mini-stream rather than the main sector chain. The specification sets this to 0x1000 (4,096 bytes). Any other value redirects stream data between the mini-FAT and the main FAT in ways that standard parsers may not expect, potentially hiding content from tools that assume the default.

The File Allocation Table (FAT) contains sector IDs that must resolve to valid file offsets. A sector ID pointing beyond the physical file size creates a phantom sector—data that some parsers will attempt to read (and fail) while others will skip silently. The Double Indirect FAT (DIFAT) at header offset 0x0044 holds a count of DIFAT sectors and up to 109 direct sector pointers. Setting DIFATSecCount to zero while populating the direct pointer array causes many parsers to ignore the DIFAT entirely, leaving whole FAT sectors unreachable by compliant tools but accessible to custom readers.

Forensic indicators

  • Read the MiniSectorCutoff value. Reject or quarantine any file where it is not exactly 0x1000.
  • Walk every FAT sector chain. For each sector ID, calculate the corresponding file offset and confirm it lies within the file’s total byte length. Flag any sector ID that resolves beyond EOF.
  • Compare DIFATSecCount (offset 0x0044) against the actual number of non-zero entries in the 109-slot DIFAT array starting at offset 0x004C. If the count is zero but entries exist, the file contains intentionally hidden FAT sectors.

Metadata Leakage: Custom Properties, Hyperlink Bases, and Print Areas

XLS files embed metadata in structured records that survive standard metadata-stripping tools. The CustProp record (0x080A) stores arbitrary name-value pairs. These frequently contain database connection strings, internal server paths, or API keys pasted by users who assumed the data would remain invisible. The HLink record (0x01B8) includes a hyperlink base field that captures the directory path from which the file was originally saved—a direct leak of the author’s file-system structure.

The PrintArea record (0x001E) and PrintTitles record (0x0033) define print ranges and repeated row/column titles. These ranges use named references that can expose internal naming conventions, sheet codenames, or range labels not visible in the cell grid. The DocStat record (0x001D) holds the revision number and the username of the last person to save the file, which may differ from the author metadata in the summary streams.

Sanitization procedure

  • Locate the CustProp record by scanning for opcode 0x080A. Delete the 12-byte record header plus the cch bytes that follow. Recalculate any downstream record offsets if the file is being rewritten.
  • For each HLink record, overwrite the hyperlink base string with null bytes while preserving the record’s length field. Do not delete the record, as removing it can shift offsets and corrupt cross-references.
  • Zero the PrintArea and PrintTitles records using the same length-preserving approach. These records are not required for the file to open correctly.
  • Clear the SummaryInformation and DocumentSummaryInformation OLE2 streams by overwriting their contents with null bytes. Maintain the original stream sizes. Standard tools such as exiftool -All= handle these streams but will not touch the binary records described above.

Reference for xls security privacy hidden data checklist

Microsoft Corporation. (2007). [MS-XLS]: Excel Binary File Format (.xls) Structure. https://learn.microsoft.com/en-us/openspecs/officefileformats/ms-xls/