Act nowcan affect a running systemThe raw payload records no superseded_by successor for any non-merge commit. Build 2.4.17888 is therefore the complete edition head; the avoid window above comes from explicit same-day follow-up fixes in the embedded commit sequence.
HTTP request limits close two memory-exhaustion paths
Two HTTP parsing fixes prevent oversized chunked bodies and unterminated header or chunk-size lines from consuming memory beyond the configured limits. Windows backends also receive a substantial SChannel and CNG mTLS pass, while REST, ORM, ClientDataSet and DHCP users get targeted correctness fixes. Teams exposing mORMot HTTP servers should prioritize this edition.
TL;DR
- THttpAsyncServer now rejects unterminated header and chunk-size lines once they exceed MaxHttpHeaderLineSize instead of buffering them indefinitely.
- MaximumAllowedContentLength now limits chunked bodies buffered in memory by both synchronous and asynchronous HTTP servers.
- Windows SChannel clients can use TNetTlsContext.CertificateRaw for mTLS, with corrected CNG PFX persistence, cleanup and Delphi 13 compilation.
- TRest.OneFieldValue, TOrmModel.SqlFromSelectWhere, ToClientDataSet and TDhcpServer receive concrete correctness fixes.
Upgrade advice
Land on edition head 5df7dc803073b59d037470aa29dc3b8adca9e65f, build 2.4.17888. Do not stop inside the Windows mTLS sequence: the initial CertificateRaw client support is followed by PFX ownership and cleanup fixes, then a Delphi 13 type-qualification fix at build 2.4.17883. HTTP server operators should pull the final head for both request-limit fixes.
23 of 23 entries · 32 commits upstream
1
High
Async HTTP parser stops endless header and chunk-size lines
THttpRequestContext.ProcessParseLine sets hrsErrorRejected as soon as an unterminated line exceeds MaxHttpHeaderLineSize. ProcessRead now surfaces that rejection immediately for request lines, headers and chunk framing instead of waiting for more input.
Security
mormot.net.http
53c7258f+78-3
net: THttpAsyncServer rejects an endless header or chunk size line at once
Impact
Before this fix, THttpAsyncServer could buffer a header or chunk-size line with no CR indefinitely, allowing a slow client to consume memory without respecting header or content limits. It now returns HTTP 400 and closes the request path promptly.
Upgrade recommended
Upgrade every internet-facing THttpAsyncServer to build 2.4.17888 and keep MaxHttpHeaderLineSize at a bounded value.
Units
2
High
Chunked request bodies now obey MaximumAllowedContentLength in memory
THttpAsyncServerConnection.DoHeaders and THttpServerSocket.GetRequest set ContentMaxSize for every request before OnBodyDownload. The synchronous server also converts in-memory EHttpSocketOverflow into an HTTP 413 response before closing.
Security
mormot.net.async+1
432fea6b+72-5
net: MaximumAllowedContentLength now bounds a chunked body buffered in memory
Impact
A chunked body buffered as Content could previously grow toward MaxHttpInMemSize, up to 1 GB, even when MaximumAllowedContentLength was smaller. Both server families now enforce the configured boundary whether OnBodyDownload is absent or returns nil.
Upgrade recommended
Upgrade exposed THttpServer and THttpAsyncServer instances to build 2.4.17888 and verify that chunked uploads above MaximumAllowedContentLength receive rejection or HTTP 413.
Public API
MaximumAllowedContentLengthbehaviour-changed — The limit now covers in-memory chunked bodies on both HTTP server families.
3
High
CNG certificate operations no longer dereference a missing logger
TCryptPrivateKeyCng.DecryptPkcs1, TCryptCertAlgoCng.LoadStore and TCryptCertCng.LoadPkcs12 guard every local ISynLog call with Assigned(log), while preserving cleanup of certificate contexts and stores.
Fixes
mormot.crypt.win
4c033a8d+35-26
crypt: fixed GPF in TCryptCertCng when no logging is enabled
Impact
Windows backends using TCryptCertCng with logging disabled could hit a GPF during decrypt, store enumeration or PFX import. Those paths now complete or report failure without dereferencing nil; non-Windows backends are unaffected.
Upgrade recommended
Upgrade Windows services using TCryptCertCng, especially when TSynLog is disabled or no local logger is created, and retest PFX import and private-key decrypt paths.
Public API
TCryptCertCng operations without loggingbehaviour-changed — Decrypt, store-load and PFX-load paths now tolerate a nil local logger.
Units
4
High
DHCP scope lookup now advances through the server-thread list
TDhcpServer.GetThread increments the thread pointer t on each failed subnet match instead of incorrectly advancing the input PDhcpScope pointer s.
Fixes
mormot.net.dhcp
174c10a5+3-3
net: fixed TDhcpServer.GetThread loop
Impact
A DHCP server with multiple bound threads could repeatedly inspect the first thread, read beyond the supplied scope record and fail to reuse the matching thread. This fix restores deterministic scope-to-thread lookup.
Upgrade recommended
Upgrade DHCP deployments with multiple scopes or bound interfaces and test that each scope reuses its expected TDhcpServerThread.
Units
5
High
REST single-field queries now forward format arguments and bounds
The TRest.OneFieldValue overload accepting WhereClauseFmt, Args and Bounds now forwards all three values to fOrm.OneFieldValue instead of dropping Args and Bounds.
Fixes
mormot.rest.core
98fa646d+3-3
rest: fixed TRest.OneFieldValue as reported by #722
Impact
Existing calls to this overload could execute a formatted WHERE clause without its supplied values and bounds, returning the wrong row or failing the query. Delphi and FPC callers now get the intended bound query.
Upgrade recommended
Upgrade and rerun tests for TRest.OneFieldValue calls that pass both Args and Bounds; no source migration is required.
Public API
TRest.OneFieldValue(Table, FieldName, WhereClauseFmt, Args, Bounds)behaviour-changed — Args and Bounds are now forwarded to the ORM layer.
Units
6
Medium
Async keep-alive requests retain configured header options
THttpAsyncServerConnection.HttpInit reapplies fDefaultRequestOptions after THttpRequestContext.Reset clears Options, so hsoHeadersUnfiltered and hsoHeadersSanitize affect every request on a reused connection.
Fixes
mormot.net.async
f72cca69+62-1
net: THttpAsyncServer request options now apply to every kept-alive request
Impact
Previously only the first request on an async keep-alive connection received the configured header filtering policy. Later requests now see consistent raw-header retention or sanitization on Delphi and FPC servers.
Upgrade recommended
Upgrade THttpAsyncServer deployments using hsoHeadersUnfiltered or hsoHeadersSanitize and test several requests over one keep-alive connection.
Public API
THttpAsyncServer request optionsbehaviour-changed — Configured header options now apply after every keep-alive reset.
Units
7
Medium
CNG PFX loading accepts ephemeral keys and transfers SChannel ownership safely
TCryptCertCng.LoadPkcs12 only requires WinCertCtxtKeyProvider metadata when ForSChannel is true, preserves the imported store when ownership moves to the certificate, and guards failure logging when no local logger exists.
Fixes
mormot.crypt.win
f5f77294+18-16
crypt: TCryptCertCng.LoadPkcs12() fix
Impact
Regular in-process CNG signing and decryption can load PFX keys that lack reopenable provider metadata, while SChannel still rejects identities it cannot reopen. This fixes false nil results and cleanup ownership on Windows.
Upgrade recommended
Windows backends loading PFX through TCryptCertCng.LoadPkcs12 should use the edition head and test both default and ForSChannel=true paths.
Public API
TCryptCertCng.LoadPkcs12behaviour-changed — Provider metadata is mandatory only for the SChannel import mode.
Units
8
Medium
Imported CNG key cleanup scans every usable certificate safely
WinCertStoreDeleteImportedCngKeys continues past certificates without a usable CNG provider instead of exiting the whole scan, and avoids calling FindNonVoidRawUtf8 with a nil deduplication array.
Fixes
mormot.lib.sspi
e488b7ed+6-5
lib: fixed WinCertStoreDeleteImportedCngKeys()
Impact
Temporary persisted keys from an SChannel PFX chain are now all considered for deletion without a nil-array fault. Windows mTLS services avoid leaked key containers and cleanup crashes.
Upgrade recommended
Use build 2.4.17888 for SChannel PFX identities and verify that temporary CNG containers disappear after the certificate interface is released.
Public API
WinCertStoreDeleteImportedCngKeysbehaviour-changed — Cleanup now continues across mixed certificate chains and handles an empty identity set.
Units
9
Medium
ClientDataSet conversion preserves disabled controls and field handlers
ToClientDataSet restores Field.ReadOnly and Field.OnChange for existing datasets independently of the prior active-state block, and calls EnableControls only when the dataset was active and actually disabled on entry.
Fixes
mormot.db.rad.ui.cds
91d7b0af+4-5
db: fixed ToClientDataSet() as reported by #723
Impact
RAD applications no longer risk an unmatched EnableControls call for a newly created dataset, and existing field read-only flags and OnChange handlers are restored after import. This affects Delphi and FPC dataset integrations.
Upgrade recommended
Upgrade RAD backends using ToClientDataSet and retest inactive datasets plus fields with custom OnChange or ReadOnly state.
Public API
ToClientDataSetbehaviour-changed — Dataset control and field callback state is now restored conditionally and symmetrically.
Units
10
Medium
Explicit multi-table ORM projections now generate a SELECT clause
TOrmModel.SqlFromSelectWhere now passes its Sql output variable to Join when multiple tables use an explicit SqlSelect instead of '*', so the generated statement receives its SELECT prefix and fields.
Fixes
mormot.orm.core
867b1b9a+4-4
orm: fixed TOrmModel.SqlFromSelectWhere as reported by #727
Impact
Existing multi-table ORM queries with an explicit projection could produce incomplete SQL because the Join result was discarded. Those queries now execute with the intended selected fields on Delphi and FPC backends.
Upgrade recommended
Upgrade if your code calls TOrmModel.SqlFromSelectWhere with more than one table and a projection other than '*'; rerun those query tests.
Public API
TOrmModel.SqlFromSelectWherebehaviour-changed — Explicit multi-table projections now write the SELECT text into Sql.
Units
11
Medium
DHCP OFFER and ACK broadcasts now reach clients without an IPv4 address
TDhcpServerThread.OnFrameReceived sends non-relayed broadcast responses to cAnyHost32, the 255.255.255.255 limited broadcast required by RFC 2131, and removes the unused scope-broadcast field.
Fixes
mormot.net.dhcp
4ac1b5d0+2-4
net: fixed TDhcpServer broadcast response address
Impact
Clients that do not yet own an IPv4 address can receive OFFER and ACK packets through a normal UDP socket. Deployments that previously broadcast to the subnet address may stop losing initial lease responses.
Upgrade recommended
Upgrade mormot.net.dhcp deployments and verify first-lease OFFER/ACK reception from a client with no configured IPv4 address.
Public API
TDhcpServer broadcast response routingbehaviour-changed — Responses without a relay or ciaddr now use 255.255.255.255.
Units
12
Medium
Windows key-provider metadata gains certificate hashes and SChannel PFX support
TWinCertKeyProviderInfo gains a 40-character SHA-1 Hash field populated by WinCertCtxtKeyProvider. TCryptCertCng.LoadPkcs12 gains a ForSchannel option and ownership fields for a temporary persisted key store used by SChannel.
New features
mormot.crypt.win+2
f0811caf+274-47
crypt: new TWinCertKeyProviderInfo.Hash field
Impact
Windows callers can identify provider-backed certificates by hash and prepare PFX identities for SChannel. This was the first step of the sequence; use the edition head because later commits correct import and cleanup details.
Worth a look
Adopt the public Hash field if useful, but do not land on this intermediate revision for SChannel PFX; use build 2.4.17888.
Public API
TWinCertKeyProviderInfo.Hashadded — Contains the certificate SHA-1 fingerprint as 40 hexadecimal characters.TCryptCertCng.LoadPkcs12signature-changed — Adds the optional ForSchannel boolean, defaulting to false.
13
Medium
CNG PFX import separates ephemeral and SChannel key modes
TCryptCertCng.LoadPkcs12 exposes the optional ForSChannel flag: false imports a non-persistent CNG key, while true creates a named current-user key that SChannel can reopen and that the ICryptCertCng instance later deletes.
New features
mormot.crypt.win+1
121dffa6+81-145
crypt: new TCryptCertCng.LoadPkcs12 "ForSChannel" optional parameter
Impact
Windows code can now load a PFX specifically for SChannel client mTLS. The returned ICryptCertCng must remain alive for the entire TLS session because its release removes the persisted key container.
Worth a look
For SChannel mTLS, call TCryptCertCng.LoadPkcs12 with ForSChannel=true, assign WinContext to CertificateRaw, and retain the ICryptCertCng until every TLS connection closes.
Public API
TCryptCertCng.LoadPkcs12signature-changed — The optional ForSChannel boolean selects persisted SChannel-compatible import; its default is false.
14
Medium
SChannel clients can present CertificateRaw identities for mTLS
TSChannelNetTls.AfterConnection duplicates the PCCERT_CONTEXT supplied through TNetTlsContext.CertificateRaw, passes it to AcquireCredentialsHandleW, owns the outbound credential handle, and rejects anonymous fallback when an explicit certificate is refused.
New features
mormot.net.sock+1
df6b3d8f+40-9
net: implement SChannel client/server CertificateRaw support
Impact
Windows HTTP clients can perform certificate-based mutual TLS with SChannel using a certificate from a Windows store. Existing clients without CertificateRaw keep their previous anonymous-certificate behavior.
Worth a look
For Windows client mTLS, assign ICryptCertCng.WinContext to TNetTlsContext.CertificateRaw and keep the certificate interface alive until the TLS connection closes; use build 2.4.17888.
Public API
TNetTlsContext.CertificateRawbehaviour-changed — On SChannel clients it now accepts a PCCERT_CONTEXT for the outbound mTLS identity.
15
Medium
SChannel client certificates compile again with Delphi 13
TSChannelNetTls.fClientCertificate is explicitly typed as mormot.core.os.security.PCCERT_CONTEXT so it matches CertDuplicateCertificateContext instead of resolving to Winapi.Windows.PCCERT_CONTEXT.
Compiler & platform
mormot.net.sock.windows
810d843b+1-1
net: fixed Delphi compilation of TSChannelClient.fClientCertificate
Impact
Delphi 13 Windows builds using the new SChannel client CertificateRaw path no longer fail with E2010 followed by internal error D12814. FPC and older unaffected builds see no runtime change.
Upgrade recommended
Delphi 13 teams using SChannel client certificates should move to build 2.4.17883 or later; this edition head is build 2.4.17888.
16
Low
CNG store-open failure no longer falls through to enumeration
TCryptCertAlgoCng.LoadStore wraps the store.Handle=nil logging branch in begin/end, ensuring the following else belongs to the outer handle check even when logging is disabled.
Fixes
mormot.crypt.win
a9b4d77f+2-0
Update mormot.crypt.win.pas
Impact
Windows CNG store loading now stops cleanly when CertOpenStore fails instead of allowing Pascal else binding to select the enumeration path. Other platforms are unaffected.
Units
17
Low
SSPI helper removes temporary CNG keys imported from a PFX
mormot.lib.sspi adds WinCertStoreDeleteImportedCngKeys, which enumerates a freshly imported certificate store, deduplicates provider/container pairs and deletes each named CNG key through NCrypt.
New features
mormot.lib.sspi
93925cd6+69-2
lib: new WinCertStoreDeleteImportedCngKeys() function
Impact
The helper supports automatic cleanup of SChannel-compatible PFX imports. Existing applications are unchanged unless they call the new public function directly.
Public API
WinCertStoreDeleteImportedCngKeysadded — Deletes named CNG keys associated with a freshly imported temporary certificate store.
Units
18
Low
Quack protocol coverage is consolidated with DuckDB tests
The separate test.db.quack unit is removed and its mock protocol, vector decoding and live DuckDB checks move into test.db.duckdb, with added Delphi Unicode constant handling and fewer expected exception logs.
Tests
218a1dab+1156-1183
test: huge set of fixes of Quack protocol coverage
Impact
No application-code impact. The repository test layout changes, but the production Quack and DuckDB units are not modified by this commit.
19
Low
External-database batch test now releases row interfaces before teardown
TTestExternalDatabase.BatchFromOtherThread moves the test body into a nested DoTests procedure and explicitly clears ISqlDBRows values before TRestStorageExternalHook and connection properties are freed.
Tests
5df7dc80+54-46
test: fixed random GPF in TTestExternalDatabase.BatchFromOtherThread
Impact
No application-code impact. The change removes a random test-process GPF caused by transient statement interfaces outliving the properties they reference.
20
Low
Quack client tests release transient interfaces before pool shutdown
TTestQuack.ClientTest isolates connection, row and statement interfaces in a nested DoTests procedure so they are finalized before ClearConnectionPool verifies the disconnect notification.
Tests
e15e6c13+35-25
tests: fixed random GPF in TTestQuack.Client
Impact
No application-code impact. The Quack regression suite no longer intermittently dereferences connection state after its owning properties have been destroyed.
21
Low
Main regression project restores the ORM threads test unit
test/mormot2tests.dpr adds test.orm.threads back to its uses list after the Quack test consolidation accidentally removed it from the main test project.
Tests
74b7cde0+3-2
tests: fixed main project compilation after #218a1da
Impact
No application-code impact. The repository's main Delphi test project compiles again and continues to execute the ORM thread regressions.
22
Low
Windows CNG diagnostics identify skipped providers and unavailable CNG
TCryptCertCng logging now includes provider and container names for ignored certificates, emits a warning when NCrypt is unavailable, and clarifies private-key and SHA-1 details in LoadPkcs12 diagnostics.
Housekeeping
mormot.crypt.win+1
cfb55c92+12-11
crypt: slightly enhanced TCryptCertCng logging
Impact
No API or successful-path behavior changes. Windows certificate import failures become easier to diagnose; Delphi and FPC non-Windows backends are unaffected.
23
Low
Delphi-specific stack and DuckDB expressions compile without hints
mormot.core.log excludes RawStackTrace skip normalization on DELPHIPOSIX, and mormot.db.raw.duckdb casts the U128 carry expression to byte instead of ord to match Delphi typing.
Housekeeping
mormot.core.log+1
633c6f54+5-3
core: fixed some Delphi compiler hints
Impact
No runtime behavior is intentionally changed. Delphi builds lose compiler hints in these two code paths; FPC backend behavior is unchanged.