FileMetadataStripping

FileMetadataStripping (ODC)

Stable version 0.1.5 (Compatible with ODC)
Uploaded on 30 Jul by Alexandre Realinho
FileMetadataStripping

FileMetadataStripping (ODC)

Details
Detailed Description

FileMetadataStripping removes embedded metadata (EXIF, IPTC, XMP, PDF /Info, OOXML/ODF properties, RTF \info, EPUB Dublin Core, SVG title/desc, audio/video tags) from uploaded files before they reach any AI API.
File metadata carries arbitrary text invisible to users. An attacker can embed prompt-injection instructions in these fields using standard tools without altering the file visually - and if the file reaches an AI model, the injected text is processed as trusted input.

StripFileMetadata(rawFile, stripBodyAuthors) returns a clean file plus a structured JSON audit of what was found. Covers images (JPEG/PNG/GIF/TIFF/WebP/AVIF/HEIC + 40 more), documents (PDF, DOCX/XLSX/PPTX + all template & macro-enabled variants, legacy .doc/.xls/.ppt via CFBF, ODT/ODS/ODP + 9 ODF variants, Flat ODF, Word 2003 XML, RTF, EPUB, ORA, SVG), and audio/video (MP3, MP4, WAV, M4A, MOV, WebM, AIFF, APE, WavPack, MPC).
Verified by 1,440 xUnit regression tests.

Limitations

Embedded objects - OOXML charts, images, and OLE containers retain their own metadata.
ICC profiles - removed with image metadata; sRGB fallback.
Memory - no size limit; entire file loaded into memory.
Unreadable files - encrypted or corrupted files returned unchanged; ExtractedMetadata includes a processingError note.
Body authors - stripped only when StripBodyAuthors = True.
Excel threaded comments - xl/threadedComments/ retains author names.
PDF embedded images - retain their own EXIF; not processed.
VBA macros (vbaProject.bin) and digital signatures - not stripped.
HEIC / HEIF - transcoded to JPEG; x265 HEVC is GPL-licensed. transcodedFormat key set.
APNG - reading fixed; writing needs ffmpeg. Without ffmpeg, output is JPEG.
DICOM - PHI tags (patient name, ID, dates) survive; no DICOM SDK bundled.
Animated WebP - per-frame metadata survives; libwebpmux native library not bundled.
WBMP - no reliable magic bytes; returned as passthrough.

Release notes 

FileMetadataStripping v0.1.5 - 2026-07-30

This release extends metadata stripping coverage to seven new document and media families, hardens error handling on malformed containers, closes the last remaining format-coverage priorities, and grows the test suite from 720 per platform (1,440 tests total). No breaking changes.


NEW FORMATS
-----------

RTF (Rich Text Format, .rtf) - detected by the {\rtf1 prefix. Every string-bearing control word in the \info group is blanked: \author, \title, \subject, \keywords, \comment, \operator, \company, \doccomm, \category, \hlinkbase, \manager. Numeric control words (revision counters, timestamps) are preserved. Values are captured in ExtractedMetadata under the control-word name.

Legacy binary Office - CFBF (.doc, .dot, .xls, .xlt, .ppt, .pot, .pps) - detected by the 8-byte magic D0 CF 11 E0 A1 B1 1A E1. The strip path wipes the two OLE property-set streams SummaryInformation (Title, Subject, Author, Keywords, Comments, Template, Last-Saved-By, Application) and DocumentSummaryInformation (Category, Manager, Company, ContentStatus, Language, custom properties). The container is consolidated after deletion so freed sectors are dropped from the output - property values do not survive in unallocated space. New dependencies: OpenMcdf 3.1.4 (MPL-2.0) and OpenMcdf.Ole 3.1.4-experimental.1 (MPL-2.0).

Flat ODF (.fodt, .fods, .fodp) - single-file XML variant of ODF detected by the root in the OASIS office namespace. Reuses the same meta.xml strip logic as ZIP-based ODF: blanks every dc:* and meta:* child of (creator, title, description, subject, initial-creator, generator, editing-cycles, editing-duration, user-defined). Output remains a valid Flat ODF XML document.

Word 2003 XML - WordProcessingML (.xml) - detected by the WordProcessingML namespace URL. Strips every child of (Author, LastAuthor, Company, Manager, Title, Subject, Keywords, Description, Category, Template, HyperlinkBase, ...) and removes every child of . When StripBodyAuthors = True, also blanks w:author and aml:author attributes on tracked-change and comment elements throughout the body.

SVG - dedicated XML-aware strip path that removes ,

License

FileMetadataStrip is released under the MIT License.

Copyright (c) 2026 AR.

Permission is granted, free of charge, to any person obtaining a copy of this software (the "Software"), to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, subject to including the above copyright notice and this permission notice in all copies.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. THE AUTHORS ARE NOT LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM ITS USE.

Bundled third-party dependencies retain their own licenses:
- Magick.NET-Q8-AnyCPU 14.15.0 - Apache 2.0
- DocumentFormat.OpenXml 3.5.1 - MIT
- PDFsharp 6.2.4 - MIT
- OpenMcdf and OpenMcdf.Ole 3.1.4 - MPL 2.0
- TagLibSharp 2.3.0 - LGPL 2.1 or MPL 1.1 (dual-licensed)
- OutSystems.ExternalLibraries.SDK 1.5.0 - OutSystems proprietary (required by ODC)