Thread View: linux.debian.bugs.dist
1 messages
1 total messages
Started by Wilfried Heintz
Wed, 25 Nov 2026 11:40
Bug#1155239: liblasso3: lasso_server_load_metadata takes ~20 s per request with a 1591-entity metadata aggregate on bookworm (Op...
Author: Wilfried Heintz
Date: Wed, 25 Nov 2026 11:40
Date: Wed, 25 Nov 2026 11:40
99 lines
9515 bytes
9515 bytes
Package: liblasso3
Version: 2.8.1-1+deb12u1
Severity: normal
Hello,
Here is a report generated with Claude.ai following an issue of
authentication on my debian server.
Hope it will be useful.
Cheers,
Wilfried
---
"SUMMARY
-------
With libapache2-mod-auth-mellon 0.18.1-1 and a SAML federation metadata
aggregate containing 1591 EntityDescriptor elements (about 11 MB),
every request handled by mod_auth_mellon takes about 21 s of CPU time
on bookworm. A backtrace taken during such a request shows the time is
spent in lasso_server_load_metadata(), in the initialisation of an
xmlsec keys manager that loads the system default CA store
(X509_STORE_set_default_paths_ex) and decodes the certificates through
OpenSSL 3 decoders. The delay grows with the number of entities in the
aggregate.
I believe, but am not 100% sure, that the same setup did not show this
delay on bullseye (OpenSSL 1.1.1) before I upgraded the server.
ENVIRONMENT
-----------
Debian 12 (bookworm), amd64
libapache2-mod-auth-mellon 0.18.1-1
liblasso3 2.8.1-1+deb12u1
libssl3 3.0.22-1~deb12u2
libxmlsec1-openssl 1.2.37-2
libxml2 2.9.14+dfsg-1.3~deb12u6
apache2 2.4.71-1~deb12u1
No newer version of these packages is available in bookworm / bookworm-
security.
CONFIGURATION (sanitised)
-------------------------
<Location />
AuthType Mellon
MellonEnable "auth"
MellonSPMetadataFile ...
MellonIdPMetadataFile /etc/apache2/mellon/federation-idps.xml #
1591 EntityDescriptor, ~11 MB
MellonIdPMetadataFile /etc/apache2/mellon/other.xml # 1
EntityDescriptor
MellonIdPCAFile /etc/apache2/mellon/federation-signing-cert.pem
</Location>
Unauthenticated users are redirected to a SAML discovery service
(WAYF).
The same aggregate is referenced by about 20 virtual hosts on this
server.
Commenting out MellonIdPCAFile and MellonIdPPublicKeyFile does not
change
the delay.
SYMPTOM
-------
curl timings for the home page of one virtual host:
dns 0.018 s, connect 0.020 s, tls 0.033 s, time to first byte 21.5 s
The response is a 303 redirect to the discovery service, which itself
answers in 92 ms. Repeated requests all take 19-22 s (not only the
first request after a restart). During the request one apache2 process
is at 99.9 % CPU; strace -f shows no blocking system call (only idle
epoll_wait/futex in other threads), so the time is CPU-bound.
BACKTRACE (gdb, no debug symbols installed)
-------------------------------------------
#0 OPENSSL_sk_value () from libcrypto.so.3
#1 ?? () from libcrypto.so.3
#2 OSSL_DECODER_do_all_provided () from libcrypto.so.3
#3 ?? () from libcrypto.so.3
#4 OSSL_DECODER_CTX_new_for_pkey () from libcrypto.so.3
#5-#10 ?? () from libcrypto.so.3
#11 ASN1_item_d2i_ex () from libcrypto.so.3
#12 PEM_X509_INFO_read_bio_ex () from libcrypto.so.3
#13 X509_load_cert_crl_file_ex () from libcrypto.so.3
#14 ?? () from libcrypto.so.3
#15 X509_STORE_set_default_paths_ex () from libcrypto.so.3
#16 ?? () from libxmlsec1-openssl.so.1
#17 xmlSecKeyDataStoreCreate () from libxmlsec1.so.1
#18 xmlSecOpenSSLKeysMngrInit () from libxmlsec1-openssl.so.1
#19 xmlSecOpenSSLAppDefaultKeysMngrInit () from libxmlsec1-openssl.so.1
#20-#25 ?? () from liblasso.so.3
#26 lasso_server_load_metadata () from liblasso.so.3
#27-#28 ?? () from mod_auth_mellon.so
#29 am_auth_mellon_user () from mod_auth_mellon.so
SCALING WITH THE NUMBER OF ENTITIES
-----------------------------------
I filtered the aggregate with an XSLT stylesheet to keep only the first
N entityIDs of the sorted list, and measured one request after each
reload (single measurements, so only indicative):
N = 1 0.47 s
N = 100 2.34 s
N = 400 3.64 s
N = 1591 about 21.8 s (full aggregate)
The growth is not strictly linear.
For comparison, reading the system CA bundle (150 certificates) with
"openssl storeutl -noout -certs /etc/ssl/certs/ca-certificates.crt"
takes about 41 ms wall time (including process startup). 1591 x 41 ms
is about 65 s, the same order of magnitude as the observed delay, which
suggests (but does not prove) that the default CA store is loaded once
per entity.
HYPOTHESIS
----------
lasso_server_load_metadata() seems to initialise an xmlsec keys
manager, which loads the whole default CA store, for each entity (or at
least many times) of a federation aggregate, and certificate decoding
is much slower with OpenSSL 3.0 than it was with 1.1.1. In addition,
mod_auth_mellon seems to call lasso_server_load_metadata() while
handling each request (the backtrace is under am_auth_mellon_user and
every request is slow), instead of once per process. I have not
verified this in the source code.
QUESTIONS
---------
- Is this a known problem with large federation aggregates on OpenSSL
3?
- Could the keys manager / certificate store be created once instead of
per entity, or the loaded metadata be cached between requests?
- Is there a recommended way to use large aggregates with Mellon, other
than filtering them to the few IdPs actually needed? (Filtering
reduces the delay, but 100+ IdPs are still about 2-3 s per request.)
I can provide more traces (perf, gdb with debug symbols) or test
patches on this server if useful.
Thank you."
--
Wilfried Heintz
UMR INRAe 1201 Dynafor
CS 52627 - 31326 Castanet Tolosan Cedex (43.529130N, 1.49969E)
tel. +33 (0)5 61 28 55 16 | mob. +33 (0)7 64 51 25 82
ORCID https://orcid.org/0000-0002-9244-9766
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads