mORMot2 DailyDaily read of upstream commits

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.

Build2.4.17856 → 2.4.17888
Commits32
Lines+2318 -1570
Read6 min

23 of 23 entries · 32 commits upstream

Stories
# Entry Category Units
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.

Sven Harazim · 16:28 UTC · view the commit on GitHub →

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.

Public API

  • MaximumAllowedContentLengthbehaviour-changed — The limit now covers in-memory chunked bodies on both HTTP server families.

Sven Harazim · 16:20 UTC · view the commit on GitHub →

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.

Public API

  • TCryptCertCng operations without loggingbehaviour-changed — Decrypt, store-load and PFX-load paths now tolerate a nil local logger.

Arnaud Bouchez · 07:39 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 16:50 UTC · view the commit on GitHub →

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.

Public API

  • TRest.OneFieldValue(Table, FieldName, WhereClauseFmt, Args, Bounds)behaviour-changed — Args and Bounds are now forwarded to the ORM layer.

Arnaud Bouchez · 16:33 UTC · PR #722 · view the commit on GitHub →

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.

Public API

  • THttpAsyncServer request optionsbehaviour-changed — Configured header options now apply after every keep-alive reset.

Sven Harazim · 16:23 UTC · view the commit on GitHub →

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.

Public API

  • TCryptCertCng.LoadPkcs12behaviour-changed — Provider metadata is mandatory only for the SChannel import mode.

Arnaud Bouchez · 14:59 UTC · view the commit on GitHub →

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.

Public API

  • WinCertStoreDeleteImportedCngKeysbehaviour-changed — Cleanup now continues across mixed certificate chains and handles an empty identity set.

Arnaud Bouchez · 14:42 UTC · view the commit on GitHub →

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.

Public API

  • ToClientDataSetbehaviour-changed — Dataset control and field callback state is now restored conditionally and symmetrically.

Arnaud Bouchez · 16:31 UTC · PR #723 · view the commit on GitHub →

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.

Public API

  • TOrmModel.SqlFromSelectWherebehaviour-changed — Explicit multi-table projections now write the SELECT text into Sql.

Arnaud Bouchez · 18:47 UTC · PR #727 · view the commit on GitHub →

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.

Public API

  • TDhcpServer broadcast response routingbehaviour-changed — Responses without a relay or ciaddr now use 255.255.255.255.

zen010101 · 11:05 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 14:31 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 14:34 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 07:40 UTC · view the commit on GitHub →

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.

Sven Harazim · 18:52 UTC · view the commit on GitHub →

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.

Thomas Prud'homme · 13:08 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 14:32 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 17:45 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 20:09 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 20:02 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 18:54 UTC · PR #218 · view the commit on GitHub →

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.

Arnaud Bouchez · 16:25 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 19:45 UTC · view the commit on GitHub →

Upstream activity commits per day · last 60 days
Commits1007
Active days49/60
Busiest2026-09-30
Peak60
2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 12 commits2026-10-11: 2 commits2026-10-12: 40 commits2026-10-13: 31 commits2026-10-14: 23 commits2026-10-15: 16 commits2026-10-16: 27 commits2026-10-17: 0 commits2026-10-18: 0 commits2026-10-19: 0 commits2026-10-20: 0 commits2026-10-21: 0 commits2026-10-22: 3 commits2026-10-23: 6 commits2026-10-24: 29 commits2026-10-25: 7 commits2026-10-26: 25 commits2026-10-27: 4 commits2026-10-28: 8 commits2026-10-29: 17 commits2026-10-30: 20 commits2026-10-31: 0 commits2026-11-01: 0 commits2026-11-02: 16 commits2026-11-03: 32 commits2026-11-04: 15 commits2026-11-05: 32 commits2026-11-06: 26 commits2026-11-07: 19 commits2026-11-08: 2 commits2026-11-09: 29 commits2026-11-10: 17 commits2026-11-11: 8 commits2026-11-12: 38 commits2026-11-13: 39 commits2026-11-14: 9 commits2026-11-15: 6 commits2026-11-16: 21 commits2026-11-17: 30 commits2026-11-18: 37 commits2026-11-19: 28 commits2026-11-20: 31 commits2026-11-21: 0 commits2026-11-22: 0 commits2026-11-23: 1 commit2026-11-24: 6 commits2026-11-25: 3 commits2026-11-26: 3 commits2026-11-27: 0 commits2026-11-28: 0 commits
2026-09-302026-11-28