🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #6071

Bug#1155239: liblasso3: lasso_server_load_metadata takes ~20 s per request with a 1591-entity metadata aggregate on bookworm (Op...

#6071
From: Wilfried Heintz
Date: Wed, 25 Nov 2026 11:40
99 lines
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


Technical Details
Message-ID: <O3jvY-e3K0-7@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!bofh.it!news.nic.it!robomod
From: Wilfried Heintz <wilfried.heintz@inrae.fr>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1155239: liblasso3: lasso_server_load_metadata takes ~20 s per request with a 1591-entity metadata aggregate on bookworm (OpenSSL 3)
Date: Wed, 25 Nov 2026 12:40:02 +0100
Message-ID: <O3jvY-e3K0-7@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Nov 25 11:35:15 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.451
Reply-To: Wilfried Heintz <wilfried.heintz@inrae.fr>, 1155239@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: fpeters@debian.org
X-Debian-Pr-Message: report 1155239
X-Debian-Pr-Package: liblasso3
X-Debian-Pr-Source: lasso
Thread-Topic: liblasso3: lasso_server_load_metadata takes ~20 s per request
 with a 1591-entity metadata aggregate on bookworm (OpenSSL 3)
Thread-Index: AQHdfNDnb4kbboIFqk+aL7Ux7LPd1Q==
Accept-Language: fr-FR, en-US
Content-Language: en-US
X-Originating-IP: [147.100.174.19]
Content-Type: text/plain; charset="utf-8"
Content-ID: <A81CDD308EA1694A8F613A3AE8FC1FB5@inrae.fr>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-Crossassassin-Score: 2
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2004886
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 99
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 25 Nov 2026 11:34:17 +0000
X-Original-Message-ID: <4569d1195a0c17de705944bf1c5006de3d047ca5.camel@inrae.fr>