https://gnocchi-internal.googlesource.com/third_party/epplus, branch main).xlsx, .xlsm) spreadsheets within AppSheet backend services.XmlDocument, XmlReader, and XPath operations (e.g., verify that XmlReaderSettings.ProhibitDtd = true / DtdProcessing.Prohibit and XmlResolver = null are strictly enforced across XmlHelper.cs, ZipPackage.cs, ExcelStyles.cs, ExcelWorksheets.cs, and table/drawing components).ZipPackage.cs (ZipArchive handling) for Zip Slip path traversal vulnerabilities (e.g., handling malformed entry full names or URI paths containing ../), uncompressed size limits, and zip bomb resource exhaustion.FormulaParsing/FormulaParser.cs, ExpressionGraph, LexicalAnalysis) for recursive stack overflow, unhandled exceptions, denial-of-service via circular references, or unintended method invocation.CellStore.cs when processing large row/column indices or sparse matrices crafted to cause OutOfMemory errors.| Entry Point | Type | Trusted? | Validation |
|---|---|---|---|
ExcelPackage(Stream) / ExcelPackage(FileInfo) | API Constructor / File Input | No | Validates stream existence; delegates archive decompression to ZipPackage |
ZipPackage(Stream) | Archive Decompressor | No | Checks for [content_types].xml and relationship parts; reads entry streams into byte arrays |
XmlHelper.LoadXmlSafe(XmlDocument, Stream) | XML Deserialization | No | Configures XmlReaderSettings.ProhibitDtd = true before loading into XmlDocument |
FormulaParser.Parse(string) / ExcelRangeBase.Calculate() | Formula Engine | No | Lexical tokenization and expression graph evaluation of formula strings |
ExcelWorksheet.Cells[...] / CellStore | Data Ingestion | No | Range address parsing, dimension bounding, and cell value type mapping |
| Data Type | Source | Destination | Protection |
|---|---|---|---|
| Customer | External File | AppSheet Memory / | In-memory |
: Spreadsheet : Upload / Data : CellStore : processing; : | |||
| : Content : Source : : protected by host : | |||
| : : : : sandbox and TLS : | |||
| : : : : transport : | |||
| Spreadsheet | Excel File Parts | Formula Parsing | Evaluated in |
| : Formulas & : : Engine : memory; restricted : | |||
| : Macros : : : to supported : | |||
| : : : : spreadsheet : | |||
| : : : : function library : | |||
| Office Document | OpenXML | OfficeProperties | Parsed into |
| : Metadata : Properties : object : strongly-typed : | |||
| : : : : metadata : | |||
| : : : : properties : |
| Action | Location | Guard |
|---|---|---|
| File Read / Stream | ExcelPackage.Load / | Validates stream integrity |
: Ingestion : ZipPackage.ZipPackage : : | ||
| File Write / | ExcelPackage.Save / | File system permissions of |
: Serialization : ExcelPackage.SaveAs : running process : | ||
| XML Deserialization | XmlHelper.LoadXmlSafe | DTD prohibition settings |
XmlReader settings prohibiting DTD processing and external entity resolution.ZipPackage.cs part URI parsing and relationship mapping (ReadRelation) to ensure no arbitrary path escapes occur during package part extraction.FormulaParsing components for recursive evaluation depth limits, CPU consumption attacks, and safe handling of malformed formulas.CellStore.cs and worksheet data structures for defensive memory allocation bounds when handling massive or maliciously sparse spreadsheets.