Act nowcan affect a running systemThe raw payload contains no superseded_by field, so no successor or still-moving status is claimed. Version include-only changes were ignored as bookkeeping. The analysis describes memory-safety hazards demonstrated by the diffs without asserting exploitability.
JSON and YAML writers close multiple buffer-overflow paths
This edition hardens the framework's JSON and YAML paths against oversized or malformed input. A sequence of commits replaces fixed-size short writes used with unbounded values, protects JSON reformatting at buffer boundaries, applies YAML depth limits to compact forms and rejects embedded NUL bytes. PostgreSQL JSONB and numeric output, SOA logging, interface command-line decoding and CSV output share the same safer writer path. Crypto users should also review the new ECrypt inheritance relationship.
TL;DR
- Upgrade if untrusted or large values can reach JSON, YAML, PostgreSQL JSONB/numeric output, SOA logging or CSV generation.
- JSON reformatting now checks capacity for dynamic tokens and structural delimiters instead of using fixed-size or direct writes.
- YAML parsing now enforces depth in compact structures, rejects embedded NUL and validates quoted flow scalars.
- ECrypt now descends from ESynCrypto so one ESynCrypto handler can cover the crypto stack.
Upgrade advice
Upgrade to the complete edition head, build 2.4.17934, rather than cherry-picking one writer fix. Keep the JSON hardening sequence through 2.4.17924 and the YAML follow-ups through 2.4.17933 together. Re-test oversized JSON tokens, long PostgreSQL JSONB/numeric values, deeply nested compact YAML and YAML containing NUL. Review exception handlers that distinguish ECrypt from ESynCrypto.
16 of 16 entries · 19 commits upstream
1
Critical
TJsonParser stops short-writing unbounded tokens
PreprocVar and Reformat move unbounded numbers and escaped strings from AddShort to AddNoJsonEscape; AddShort documentation now explicitly limits callers to 255 bytes.
Security
mormot.core.json+1
31689eed+9-7
core: fixed three unbounded dynamic token writes in TJsonParser
Impact
Delphi and FPC JSON preprocessing and reformatting no longer route large dynamic tokens through a fixed temporary buffer, removing the memory-corruption path identified by the diff.
Upgrade recommended
Prioritize the complete edition for any service that preprocesses or reformats untrusted JSON; test tokens well above 255 bytes and the 70,000-character regression case.
2
High
YAML compact recursion and quoted keys are bounded
TYamlToJson applies YamlMaxDepth to compact sequences and implicit maps, fully consumes quoted keys and rejects trailing text, and fixes the line-comment pointer check.
Security
mormot.core.fmt
610a95a2+32-14
core: fixed YAML parsing for overflows
Impact
Delphi and FPC YAML backends no longer let compact syntax bypass the depth limit or accept extra material after a quoted scalar.
Upgrade recommended
Upgrade YAML ingestion paths and test deeply nested compact collections plus quoted keys with trailing text.
Units
3
High
Long JSON-facing output uses capacity-aware writes
Unbounded interface argument values, CSV separators, database column names and SOA client-IP headers now use AddNoJsonEscape instead of AddShort.
Security
mormot.core.interfaces+3
013da880+6-6
core: hardened JSON output against buffer overflows
Impact
Delphi and FPC backends avoid fixed short-buffer writes when these externally influenced values exceed 255 bytes.
Upgrade recommended
Upgrade backends that serialize long command arguments, CSV, database metadata or proxy-provided client headers, and add values above 255 bytes to regression tests.
4
High
JSON reformatting guards buffer boundaries
TJsonParser.Reformat uses TTextWriter.LastChar for empty-safe inspection and capacity-aware Add for opening and closing delimiters instead of AddDirect.
Security
mormot.core.json
23b709e4+6-6
core: fixed potential buffer overflow during JSON reformat
Impact
Delphi and FPC applications reformatting large or deeply nested JSON avoid unchecked delimiter writes and empty-buffer access.
Upgrade recommended
Upgrade code that reformats external JSON and include large nested arrays and objects in regression tests.
Units
5
High
Long JSON properties and PostgreSQL values avoid short writes
JsonObjectAsJsonArrays property names and PostgreSQL numeric, JSON and JSONB column values now use AddNoJsonEscape instead of AddShort.
Security
mormot.core.json+1
77c73fe6+5-5
core: fixed other potential buffer overflows
Impact
Delphi and FPC database backends can serialize property names and PostgreSQL values above 255 bytes without a fixed short-buffer write.
Upgrade recommended
Upgrade PostgreSQL backends and JSON object-array conversions, then test long JSONB, numeric text and property names.
6
High
YAML input rejects embedded NUL bytes
TYamlToJson scans each bounded input line for #0 and reports an error instead of letting a sentinel terminate parsing before the declared buffer end.
Security
mormot.core.fmt
788814ef+5-3
core: fixed TYamlToJson to reject #0 within input buffer
Impact
Delphi and FPC backends no longer accept a truncated YAML prefix when bytes remain after an embedded NUL, preventing parser-consumer disagreement on the same buffer.
Upgrade recommended
Upgrade services that parse externally supplied YAML and add a rejection test for NUL inside the declared buffer.
Units
7
High
Text preprocessing accepts long substitutions safely
TPreproc.ExpandTo and TPreprocText.TextPreprocessToWriter write variable-length substitutions with AddNoJsonEscape rather than AddShort.
Security
mormot.core.fmt
02bdc167+4-4
core: fixed two further variable-length substitutions in mormot.core.fmt
Impact
Delphi and FPC text templates can expand substitutions beyond 255 bytes without entering a fixed short-write path.
Upgrade recommended
Upgrade if template substitutions can contain long or externally supplied text, and test values above 255 bytes.
Units
8
Medium
Quoted YAML flow scalars parse correctly
TYamlToJson only invokes quoted-token scanning when the quote begins the current flow token, preserving quotes embedded in plain scalars and delimiters inside quoted values.
Fixes
mormot.core.fmt
0dcd7087+4-3
core: fixed quoted scalars in YAML flow collections
Impact
Delphi and FPC applications converting YAML flow sequences or maps no longer split valid quoted values at embedded commas or misread mid-scalar quotes.
Upgrade recommended
Upgrade if you convert YAML flow collections, then re-test quoted values containing commas or nested flow syntax.
Units
9
Medium
ECrypt joins the ESynCrypto hierarchy
ECrypt now inherits from ESynCrypto instead of ESynException, making factory exceptions part of the common crypto exception hierarchy.
Compiler & platform
mormot.crypt.secure
a0669b27+4-1
crypt: ECrypt now inherits from ESynCrypto
Impact
On Delphi and FPC, an except on ESynCrypto now catches ECrypt and its descendants; handlers that deliberately distinguish the old sibling classes may observe different matching.
Worth a look
Review ordered exception handlers for ESynCrypto and ECrypt, especially code adopting the ESynCrypto handler introduced by the preceding edition.
Public API
ECryptbehaviour-changed — Its base class changes from ESynException to ESynCrypto.
Units
10
Low
JSON parser state initialization is made explicit
TJsonParser.Init now initializes RootCount, and GetJsonPropName checks info.Json before using an unescaped field.
Under the hood
mormot.core.json
906e3f85+6-5
core: two small JSON refactoring to please ValGrid
Impact
This is defensive cleanup for Delphi and FPC JSON parsing; no public contract changes.
Units
11
Low
DuckDB and Quack internals are simplified
DuckDBVariantSql trims trailing semicolons with FakeLength, and TQuackResponse.NewType uses PtrArrayAdd for pool growth.
Under the hood
mormot.db.raw.duckdb
6b5fac71+4-7
db: minor DuckDB + Quack refactoring
Impact
No functional change is visible for Delphi or FPC DuckDB consumers.
Units
12
Low
Quack test messages use a binary buffer writer
The DuckDB Quack server emulator replaces RawByteString concatenation with TMockQuackWriter over TBufferWriter, including explicit field and LEB128 encoding.
Tests
8dae860b+628-331
test: rewritten buggy Quack server emulator
Impact
Only test infrastructure changes; it avoids Delphi/FPC string-concatenation and code-page differences in binary fixtures.
13
Low
YAML and DuckDB regression coverage expands
Tests add quoted flow-collection, embedded NUL and malformed YAML cases, and refine the DuckDB Quack mock writer coverage.
Tests
b517ff42+92-40
tests: enhanced DuckDB and YAML coverage
Impact
No runtime behavior changes for Delphi or FPC; the preceding parser and test-emulator fixes gain regression coverage.
14
Low
Large JSON and deep YAML cases gain regression tests
Tests cover a 70,000-character JSON token, long property names, deep structural sequences, YAML injection-like quoted text and compact recursion limits.
Tests
66b5e528+28-3
test: cover latest JSON + YAML fixes
Impact
No runtime behavior changes; Delphi and FPC regression coverage demonstrates the intended boundaries of the adjacent fixes.
15
Low
DHCP scope rules gain targeted tests
Tests confirm that DISCOVER without giaddr ignores ciaddr and uses the receiving interface, while RELEASE selects the scope from ciaddr even on another interface.
Tests
bab760db+13-0
tests: DHCP scope selection of DISCOVER with ciaddr, and of RELEASE
Impact
No runtime behavior changes for Delphi or FPC; this extends coverage of the DHCP fixes from the preceding edition.
16
Low
IsValidJson limitations are documented
The API comment now states that IsValidJson, including Strict=true, is a fast parser-compatibility check rather than full RFC 8259 validation.
Docs
mormot.core.json
35f43955+5-3
core: document that IsValidJson() is not a RFC compliance validation
Impact
No Delphi or FPC runtime behavior changes; callers should not infer standards compliance from this helper.