fix(security): isolate XLSX decoding with hard resource limits

This commit is contained in:
2026-09-08 07:47:18 +02:00
parent 33de5cac55
commit be16f8218e
4 changed files with 153 additions and 8 deletions
+19
View File
@@ -132,6 +132,25 @@ explicit refresh. Missing Files capability, revoked file access, quarantine,
oversized or malformed content, inactive/stale credentials, unreachable SQL,
and timeout failures produce sanitized unavailable/validation diagnostics.
XLSX archive checks and workbook parsing run in a fresh disposable Core worker.
Each invocation allows 15 seconds wall time, 10 CPU seconds and 512 MiB virtual
address space, with no file output. The typed transport allows 8 MiB input and
64 MiB result bytes, at most 64 nesting levels and 1,000,000 value nodes. These
transport bounds include serialization overhead. The existing workbook bounds
remain 5,000,000 raw bytes, 50,000,000 expanded bytes, 5,000 archive entries,
100:1 compression ratio, 500 columns and 10,000 row positions after the header.
Authorization and exact-version file reads happen in the parent; credentials,
SQL sessions and durable changes are never passed to the parser.
Users receive an explicit failure rather than a partial source when resource
or transport limits are exceeded; reduce workbook size or complexity before
retrying. The Core `GOVOPLAN_ISOLATED_PROCESS_CONCURRENCY` setting limits active work per
API/worker process without queuing. Busy capacity may be retried later. Missing
POSIX resource controls, cancellation and worker failure produce sanitized
unavailable diagnostics; there is no in-process fallback. Operators must keep
the Core worker API available and account for the aggregate memory of all
active worker slots across API/worker replicas.
All three current providers declare projection and pagination pushdown only.
Filters, aggregations, and sorting remain in Dataflow until an adapter explicitly
declares and tests those operations.