[Pkg-sssd-devel] [Git][sssd-team/sssd][master] 5 commits: debian/patches: Add CVE-2026-104047.diff.

Mike Gabriel (@sunweaver) gitlab at salsa.debian.org
Fri Nov 13 08:00:41 GMT 2026



Mike Gabriel pushed to branch master at Debian SSSD packaging / sssd


Commits:
4e107de1 by Mike Gabriel at 2026-11-12T10:10:42+01:00
debian/patches: Add CVE-2026-104047.diff.

CVE-2026-104047: oidc_child: escape single quotes in Entra ID OData
filters.
When configured to use Microsoft Entra ID, search inputs have not been
properly sanitized before being incorporated into directory query
filters. A local user has been able exploit this vulnerability by
submitting a crafted lookup request, manipulating the query logic to
cause unauthorized information disclosure from the directory.

(Closes: #1150238).

- - - - -
d1987c37 by Mike Gabriel at 2026-11-12T10:13:11+01:00
debian/patches: Add CVE-2026-104048.diff.

CVE-2026-104048: ipa: compare users with domain awareness against HBAC
rules.

In trust-enabled identity management environments, SSSD evaluates
Host-Based Access Control (HBAC) rules by stripping domain qualifiers
and comparing only short usernames. An authenticated user in a trusted
domain who shares the same username as an authorized local account has
been able to bypass access policies and gain unauthorized access to
protected services or hosts.

(Closes: #1150238).

- - - - -
3280d3b0 by Mike Gabriel at 2026-11-13T08:54:11+01:00
debian/patches/: Add CVE-2026-104041_pre_NSS-Add-options-to-exclude-UID-and-GID.diff, CVE-2026-104041-1.diff and CVE-2026-104041-2.diff.

*_NSS-Add-options-to-exclude-UID-and-GID.diff: NSS: Add options to
exclude UID and GID (cherry-picked, in order to let patches mitigating
CVE-104041-{1,2}.diff apply cleanly).

Abstract:
:feature: UIDs and GIDs mentioned in the new options filter_uids and
  filter_gids will make SSSD avoid the LDAP search and just say that
  they don't exist. They are comma-separated lists of simple values or
  ranges:
  filter_uids = 0-999, 1234, 2000-2099

CVE-2026-104041: negcache: limit max mem size consumed by negative.
cache. Negative cache did not limit the total number of stored entries,
so far, and only removed expired records when an existing key was
rechecked, the cache could grow without bound.

- - - - -
5ad353dc by Mike Gabriel at 2026-11-13T08:59:07+01:00
debian/patches: Add CVE-2026-92821.diff.

CVE-2026-92821: ldap: pwd_expire_policy_warn does not overwrite errors
Make sure the 'pwd_expire_policy_warn' access check does not overwrite
any access denied or other errors.

- - - - -
fea666d9 by Mike Gabriel at 2026-11-13T09:00:20+01:00
d/changelog: update from Git log

- - - - -


8 changed files:

- debian/changelog
- + debian/patches/CVE-2026-104041-1.diff
- + debian/patches/CVE-2026-104041-2.diff
- + debian/patches/CVE-2026-104041_pre_NSS-Add-options-to-exclude-UID-and-GID.diff
- + debian/patches/CVE-2026-104047.diff
- + debian/patches/CVE-2026-104048.diff
- + debian/patches/CVE-2026-92821.diff
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,127 @@
+sssd (2.13.1-5) UNRELEASED; urgency=medium
+
+  * debian/patches:
+    - CVE-2026-80048: Fix flaw in sssd-kcm where a user with access to the
+      `sssd-kcm` UNIX socket has been able to cause the system to preallocate
+      significant memory by sending a large request length header, leading to
+      memory exhaustion, and thus ending in a DoS. (Closes: #1150238).
+    - CVE-2026-87853: IDP: fix user matching in `eval_access_token_buf()`. Make
+      sure it is exact, not merely a prefix match.
+    - CVE-2026-88252:  Fix flaw in sssd where a local user has been able to
+      cause a Denial of Service (DoS) by exhausting the responder service's
+      available file descriptors (system handles used for open connections).
+      (Closes: #1150238)
+    - CVE-2026-90462: LDAP: fix fail-open in ppolicy access check on zero
+      results. Don't incorrectly return success and cache an allow decision,
+      permitting continued authorization for a deleted or deprovisioned user.
+      (Closes: #1148827)
+    - CVE-2026-90994: Fix a flaw in sssd's PAM responder's protocol v1 parser,
+      where a local client with access to the PAM responder's UNIX socket as
+      been able to send an empty or truncated PAM request body, triggering an
+      out-of-bounds read, leading to a denial of service. (Closes: #1148324)
+      CVE-2026-90996: Fix a flaw in sssd where a local unprivileges user has
+      been able to send a specially crafted request with a zero-length body to
+      the Network Security Service (NSS) responder. This could have lead to a
+      denial-of-service condition, causing the NSS responder to become
+      unstable or terminate. (Closes: #1148326)
+    - CVE-2026-90463: Fix input validation vulnerability in sssd's NSS
+      responder: The vulnerability has allowed a local attacker to cause an
+      out-of-bounds read by sending specially crafted service lookup requests
+      to the NSS responder's UNIX socket, leading to crashes of the NSS
+      responder process. (Closes: #1148452)
+    - CVE-2026-90995: PAM: avoid NULL deref when service item is missing.
+      (Closes: #1148325).
+    - CVE-2026-104031: autofs: free per-request context on successful replies.
+      (Closes: #1150238).
+    - CVE-2026-104032: autofs: add 'allowed_uids' option to the autofs
+      responder. Prevent unprivileged local users from repeatedly requesting
+      master automount map updates through the autofs responder due to missing
+      authorization checks.
+      (Closes: #1150238).
+    - CVE-2026-104033: Treat shadowExpire=0 correctly. shadowExpire can be set
+      to 0, representing the beginning of the Unix epoch. An account with
+      shadowExpire set to 0 should be treated as expired.
+      (Closes: #1150238).
+    - CVE-2026-104036: nfs idmap: error out if buffer is too small. Prevent
+      denial-of-service caused by out-of-bounds writes when requesting
+      identity lookups that resolve to oversized cached entries.
+      (Closes: #1150238).
+    - CVE-2026-104038: certmap: check that SID exists in certificate. Prevent
+      from attachers being able to cause denial-of-services by certmap: check
+      that SID exists in certificate.
+      (Closes: #1150238).
+    - CVE-2026-104039: PAM: clear state pointer before freeing state itself.
+      When handling Generic Security Services Application Programming
+      Interface (GSSAPI) authentication in the Pluggable Authentication Module
+      (PAM) responder, cached connection state was freed upon completion
+      without clearing the reference pointer. This could have lead to
+      attackers being able to exploit this by sending an additional request
+      over the same connection, causing the service to access invalid memory
+      and unexpectedly terminate. (Closes: #1150238).
+    - CVE-2026-104042: pam: Guard against zero-length string auth tokens.
+      Prevent crash in PAM responder by input validation when (crafted)
+      Pluggable Authentication Module (PAM) requests containing a zero-length
+      authentication token gets sent to the responder socket. (Closes:
+      #1150238).
+    - CVE-2026-104043: nss: guard against length underflow in packet. Prevent
+      from out-of-bounds memory read during packet parsing, crashing the
+      responder process and resulting in a Denial of Service (DoS), in case a
+      local attacker with access to the Name Service Switch (NSS) responder
+      UNIX socket triggers an integer underflow by sending a specially crafted
+      request with an undersized packet header. (Closes: #1150238).
+      CVE-2026-104044: pam: prevent null dereference in kerberos passkey flow.
+      Prevent local attackers from being able to trigger a Denial of Service
+      (DoS) by sending a specially crafted Pluggable Authentication Module
+      (PAM) request when passkey authentication is enabled.
+      The additional patch CVE-2026-104044-pre.diff fixes potential memory
+      leaks and is required for CVE-2026-104044.diff to apply cleanly. (Closes:
+      #1150238).
+    - CVE-2026-104045: autofs: avoid leaked enumeration contexts after map. By
+      repeatedly sending concurrent map enumeration and invalidation requests,
+      an attacker has been able to cause memory to leak, leading to excessive
+      memory consumption that could disrupt or crash the autofs service.
+      (Closes: #1150238).
+    - CVE-2026-104046: IDP: Clean old items from open_request_table. When
+      Identity Provider (IdP) authentication had been enabled,
+      pre-authentication requests retained state in memory without being
+      cleared or timed out. A local attacker could have repeatedly initiated
+      authentication flows without completing them, causing unbounded memory
+      consumption. This memory exhaustion could have lead to a Denial of
+      Service (DoS) by degrading or terminating SSSD authentication services.
+      (Closes: #1150238).
+    - CVE-2026-104047: oidc_child: escape single quotes in Entra ID OData
+      filters.
+      When configured to use Microsoft Entra ID, search inputs have not been
+      properly sanitized before being incorporated into directory query
+      filters. A local user has been able exploit this vulnerability by
+      submitting a crafted lookup request, manipulating the query logic to
+      cause unauthorized information disclosure from the directory. (Closes:
+      #1150238).
+    - CVE-2026-104048: ipa: compare users with domain awareness against HBAC
+      rules. In trust-enabled identity management environments, SSSD evaluates
+      Host-Based Access Control (HBAC) rules by stripping domain qualifiers
+      and comparing only short usernames. An authenticated user in a trusted
+      domain who shares the same username as an authorized local account has
+      been able to bypass access policies and gain unauthorized access to
+      protected services or hosts. (Closes: #1150238).
+  * - CVE-2026-104041_NSS-Add-options-to-exclude-UID-and-GID.diff: NSS: Add
+      options to exclude UID and GID (cherry-picked, in order to let patches
+      mitigating CVE-104041-{1,2}.diff apply cleanly).
+      Abstract:
+      :feature: UIDs and GIDs mentioned in the new options filter_uids and
+        filter_gids will make SSSD avoid the LDAP search and just say that
+        they don't exist. They are comma-separated lists of simple values or
+        ranges: filter_uids = 0-999, 1234, 2000-2099
+    - CVE-2026-104041: negcache: limit max mem size consumed by negative.
+      cache. Negative cache did not limit the total number of stored entries,
+      so far, and only removed expired records when an existing key was
+      rechecked, the cache could grow without bound.
+    - CVE-2026-92821: ldap: pwd_expire_policy_warn does not overwrite errors
+      Make sure the 'pwd_expire_policy_warn' access check does not overwrite
+      any access denied or other errors.
+
+ -- Mike Gabriel <sunweaver at debian.org>  Fri, 13 Nov 2026 08:45:22 +0100
+
 sssd (2.13.1-4) unstable; urgency=medium
 
   * debian/control:


=====================================
debian/patches/CVE-2026-104041-1.diff
=====================================
@@ -0,0 +1,602 @@
+From 55b35d47caf9526e911f049f7644f848fb5661ac Mon Sep 17 00:00:00 2001
+From: Alexey Tikhonov <atikhono at redhat.com>
+Date: Fri, 30 Oct 2026 11:12:47 +0100
+Subject: [PATCH] negcache: replace selective resets with a single recreate
+ helper
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Drop sss_ncache_reset_{permanent,users,groups}() and their tdb_traverse
+delete callbacks in favor of sss_ncache_reset(), which recreates the
+in-memory tdb from scratch and repopulates the permanent entries. Both
+the domain-refresh and the NSS clearNegcache paths now use it.
+
+Assisted-By: Claude Code (Opus 4.8)
+Reviewed-by: Alejandro López <allopez at redhat.com>
+Reviewed-by: Pavel Březina <pbrezina at redhat.com>
+---
+ Makefile.am                                  |   2 +-
+ src/responder/common/negcache.c              | 153 +++-------------
+ src/responder/common/negcache.h              |  12 +-
+ src/responder/common/responder_get_domains.c |  10 +-
+ src/responder/nss/nsssrv.c                   |  16 +-
+ src/tests/cmocka/test_negcache.c             | 181 +++++--------------
+ src/tests/cmocka/test_responder_common.c     |   4 +-
+ 7 files changed, 90 insertions(+), 288 deletions(-)
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2727,7 +2727,7 @@
+     $(CMOCKA_CFLAGS)
+ responder_get_domains_tests_LDFLAGS = \
+     -Wl,-wrap,sss_parse_name_for_domains \
+-    -Wl,-wrap,sss_ncache_reset_repopulate_permanent
++    -Wl,-wrap,sss_ncache_reset
+ responder_get_domains_tests_LDADD = \
+     $(LIBADD_DL) \
+     $(CMOCKA_LIBS) \
+--- a/src/responder/common/negcache.c
++++ b/src/responder/common/negcache.c
+@@ -80,6 +80,13 @@
+     return EOK;
+ }
+ 
++/* open a memory only tdb with default hash size */
++static struct tdb_context *sss_ncache_open_tdb(void)
++{
++    errno = 0;
++    return tdb_open("memcache", 0, TDB_INTERNAL, O_RDWR|O_CREAT, 0);
++}
++
+ int sss_ncache_init(TALLOC_CTX *memctx, uint32_t timeout,
+                     struct sss_nc_ctx **_ctx)
+ {
+@@ -88,9 +95,7 @@
+     ctx = talloc_zero(memctx, struct sss_nc_ctx);
+     if (!ctx) return ENOMEM;
+ 
+-    errno = 0;
+-    /* open a memory only tdb with default hash size */
+-    ctx->tdb = tdb_open("memcache", 0, TDB_INTERNAL, O_RDWR|O_CREAT, 0);
++    ctx->tdb = sss_ncache_open_tdb();
+     if (!ctx->tdb) return errno;
+ 
+     ctx->timeout = timeout;
+@@ -494,8 +499,8 @@
+     if (min == max) {
+         /* A single ID is stored as a plain permanent entry, the same way a
+          * name coming from filter_users is. The hash lookup is cheaper than
+-         * walking the range list and sss_ncache_reset_permanent() flushes
+-         * the entry for free. */
++         * walking the range list and a cache reset flushes the entry for
++         * free. */
+         return sss_ncache_set_uid(ctx, true, dom, min);
+     }
+ 
+@@ -984,119 +989,6 @@
+     return ret;
+ }
+ 
+-static int delete_permanent(struct tdb_context *tdb,
+-                            TDB_DATA key, TDB_DATA data, void *state)
+-{
+-    unsigned long long int timestamp;
+-    bool remove_key = false;
+-    char *ep;
+-
+-    if (strncmp((char *)key.dptr,
+-                NC_ENTRY_PREFIX, sizeof(NC_ENTRY_PREFIX) - 1) != 0) {
+-        /* not interested in this key */
+-        return 0;
+-    }
+-
+-    errno = 0;
+-    timestamp = strtoull((const char *)data.dptr, &ep, 10);
+-    if (errno != 0 || *ep != '\0') {
+-        /* Malformed entry, remove it */
+-        remove_key = true;
+-        goto done;
+-    }
+-
+-    if (timestamp == 0) {
+-        /* a 0 timestamp means this is a permanent entry */
+-        remove_key = true;
+-    }
+-
+-done:
+-    if (remove_key) {
+-        return tdb_delete(tdb, key);
+-    }
+-
+-    return 0;
+-}
+-
+-int sss_ncache_reset_permanent(struct sss_nc_ctx *ctx)
+-{
+-    int ret;
+-
+-    ret = tdb_traverse(ctx->tdb, delete_permanent, NULL);
+-    if (ret < 0)
+-        return EIO;
+-
+-    sss_ncache_free_id_ranges(&ctx->uid_ranges);
+-    sss_ncache_free_id_ranges(&ctx->gid_ranges);
+-
+-    return EOK;
+-}
+-
+-static int delete_prefix(struct tdb_context *tdb,
+-                         TDB_DATA key, TDB_DATA data, void *state)
+-{
+-    const char *prefix = (const char *) state;
+-    unsigned long long int timestamp;
+-    char *ep = NULL;
+-
+-    if (strncmp((char *)key.dptr, prefix, strlen(prefix) - 1) != 0) {
+-        /* not interested in this key */
+-        return 0;
+-    }
+-
+-    errno = 0;
+-    timestamp = strtoull((const char *)data.dptr, &ep, 10);
+-    if ((errno == 0) && (*ep == '\0') && (timestamp == 0)) {
+-        /* skip permanent entries */
+-        return 0;
+-    }
+-
+-    return tdb_delete(tdb, key);
+-}
+-
+-static int sss_ncache_reset_pfx(struct sss_nc_ctx *ctx,
+-                                const char **prefixes)
+-{
+-    int ret;
+-
+-    if (prefixes == NULL) {
+-        return EOK;
+-    }
+-
+-    for (int i = 0; prefixes[i] != NULL; i++) {
+-        ret = tdb_traverse(ctx->tdb,
+-                           delete_prefix,
+-                           discard_const(prefixes[i]));
+-        if (ret < 0) {
+-            return EIO;
+-        }
+-    }
+-
+-    return EOK;
+-}
+-
+-int sss_ncache_reset_users(struct sss_nc_ctx *ctx)
+-{
+-    const char *prefixes[] = {
+-        NC_USER_PREFIX,
+-        NC_UID_PREFIX,
+-        NULL,
+-    };
+-
+-    return sss_ncache_reset_pfx(ctx, prefixes);
+-}
+-
+-int sss_ncache_reset_groups(struct sss_nc_ctx *ctx)
+-{
+-    const char *prefixes[] = {
+-        NC_GROUP_PREFIX,
+-        NC_GID_PREFIX,
+-        NULL,
+-    };
+-
+-    return sss_ncache_reset_pfx(ctx, prefixes);
+-}
+-
+ /* Parse a single filter_uids/filter_gids value, either a plain "ID" or an
+  * inclusive "MIN-MAX" range. */
+ static errno_t sss_ncache_parse_id_filter(const char *value,
+@@ -1675,16 +1567,25 @@
+     return ret;
+ }
+ 
+-/* Reset permanent negcache after checking the domains */
+-errno_t sss_ncache_reset_repopulate_permanent(struct resp_ctx *rctx,
+-                                              struct sss_nc_ctx *ncache)
++/* Recreate the negcache from scratch and repopulate permanent entries.
++ * All non-permanent entries are dropped. */
++errno_t sss_ncache_reset(struct resp_ctx *rctx,
++                         struct sss_nc_ctx *ncache)
+ {
+-    int ret;
++    struct tdb_context *tdb;
+ 
+-    ret = sss_ncache_reset_permanent(ncache);
+-    if (ret == EOK) {
+-        ret = sss_ncache_prepopulate(ncache, rctx->cdb, rctx);
++    /* Open the replacement before dropping the old one so a failure leaves
++     * the existing cache usable. */
++    tdb = sss_ncache_open_tdb();
++    if (tdb == NULL) {
++        return errno ? errno : EIO;
+     }
+ 
+-    return ret;
++    tdb_close(ncache->tdb);
++    ncache->tdb = tdb;
++
++    sss_ncache_free_id_ranges(&ncache->uid_ranges);
++    sss_ncache_free_id_ranges(&ncache->gid_ranges);
++
++    return sss_ncache_prepopulate(ncache, rctx->cdb, rctx);
+ }
+--- a/src/responder/common/negcache.h
++++ b/src/responder/common/negcache.h
+@@ -153,11 +153,6 @@
+                               struct sss_domain_info *dom,
+                               const char *sid);
+ 
+-int sss_ncache_reset_permanent(struct sss_nc_ctx *ctx);
+-/* sss_ncache_reset_[users/groups] skips permanent entries */
+-int sss_ncache_reset_users(struct sss_nc_ctx *ctx);
+-int sss_ncache_reset_groups(struct sss_nc_ctx *ctx);
+-
+ struct resp_ctx;
+ 
+ /* Set up the negative cache with values from filter_users, filter_groups,
+@@ -167,8 +162,9 @@
+                                struct confdb_ctx *cdb,
+                                struct resp_ctx *rctx);
+ 
+-/* Flush the negcache permament entries and then repopulate them */
+-errno_t sss_ncache_reset_repopulate_permanent(struct resp_ctx *rctx,
+-                                              struct sss_nc_ctx *ncache);
++/* Recreate the negcache from scratch, dropping all non-permanent entries,
++ * and repopulate the permanent entries. */
++errno_t sss_ncache_reset(struct resp_ctx *rctx,
++                         struct sss_nc_ctx *ncache);
+ 
+ #endif /* _NSS_NEG_CACHE_H_ */
+--- a/src/responder/common/responder_get_domains.c
++++ b/src/responder/common/responder_get_domains.c
+@@ -263,11 +263,10 @@
+ 
+         sss_resp_update_certmaps(state->rctx);
+ 
+-        ret = sss_ncache_reset_repopulate_permanent(state->rctx,
+-                                                    state->rctx->ncache);
++        ret = sss_ncache_reset(state->rctx, state->rctx->ncache);
+         if (ret != EOK) {
+             DEBUG(SSSDBG_OP_FAILURE,
+-                  "sss_ncache_reset_repopulate_permanent failed, ignored.\n");
++                  "sss_ncache_reset failed, ignored.\n");
+         }
+ 
+         tevent_req_done(req);
+@@ -403,11 +402,10 @@
+     }
+ 
+     if (state->optional_ncache != NULL) {
+-        ret = sss_ncache_reset_repopulate_permanent(state->rctx,
+-                                                    state->optional_ncache);
++        ret = sss_ncache_reset(state->rctx, state->optional_ncache);
+         if (ret != EOK) {
+             DEBUG(SSSDBG_MINOR_FAILURE,
+-                  "sss_ncache_reset_repopulate_permanent failed.\n");
++                  "sss_ncache_reset failed.\n");
+         }
+     }
+ 
+--- a/src/responder/nss/nsssrv.c
++++ b/src/responder/nss/nsssrv.c
+@@ -138,23 +138,13 @@
+ {
+     errno_t ret;
+ 
+-    DEBUG(SSSDBG_TRACE_FUNC, "Clearing negative cache non-permament entries\n");
++    DEBUG(SSSDBG_TRACE_FUNC, "Clearing negative cache\n");
+ 
+-    ret = sss_ncache_reset_users(nctx->rctx->ncache);
++    ret = sss_ncache_reset(nctx->rctx, nctx->rctx->ncache);
+     if (ret != EOK) {
+-        DEBUG(SSSDBG_CRIT_FAILURE,
+-              "Negative cache clearing users failed\n");
+-        goto done;
++        DEBUG(SSSDBG_CRIT_FAILURE, "Negative cache clearing failed\n");
+     }
+ 
+-    ret = sss_ncache_reset_groups(nctx->rctx->ncache);
+-    if (ret != EOK) {
+-        DEBUG(SSSDBG_CRIT_FAILURE,
+-              "Negative cache clearing groups failed\n");
+-        goto done;
+-    }
+-
+-done:
+     return ret;
+ }
+ 
+--- a/src/tests/cmocka/test_negcache.c
++++ b/src/tests/cmocka/test_negcache.c
+@@ -171,9 +171,6 @@
+     /* test when uid is present in database */
+     permanent = true;
+ 
+-    ret = sss_ncache_reset_permanent(ts->ctx);
+-    assert_int_equal(ret, EOK);
+-
+     ret = sss_ncache_set_uid(ts->ctx, permanent, NULL, uid);
+     assert_int_equal(ret, EOK);
+ 
+@@ -532,27 +529,6 @@
+ }
+ 
+ 
+-static void test_sss_ncache_reset_permanent(void **state)
+-{
+-    int ret;
+-    struct test_state *ts;
+-    const bool permanent = true;
+-
+-    ts = talloc_get_type_abort(*state, struct test_state);
+-
+-    ret = sss_ncache_set_uid(ts->ctx, permanent, NULL, 0);
+-    assert_int_equal(ret, EOK);
+-
+-    ret = sss_ncache_check_uid(ts->ctx, NULL, 0);
+-    assert_int_equal(ret, EEXIST);
+-
+-    ret = sss_ncache_reset_permanent(ts->ctx);
+-    assert_int_equal(ret, EOK);
+-
+-    ret = sss_ncache_check_uid(ts->ctx, NULL, 0);
+-    assert_int_equal(ret, ENOENT);
+-}
+-
+ static int check_user_in_ncache(struct sss_nc_ctx *ctx,
+                                 struct sss_domain_info *dom,
+                                 const char *name)
+@@ -896,67 +872,6 @@
+         ret = check_uid_in_ncache(ncache, not_filtered[j]);
+         assert_int_equal(ret, ENOENT);
+     }
+-
+-    /* A range holding a single ID is stored as a permanent entry, just like
+-     * a name coming from filter_users, so flushing the users and the groups
+-     * must leave it alone. An ordinary, non permanent ID entry is dropped. */
+-    ret = sss_ncache_set_uid(ncache, false, tc->dom, 2222);
+-    assert_int_equal(ret, EOK);
+-
+-    ret = sss_ncache_set_gid(ncache, false, tc->dom, 3333);
+-    assert_int_equal(ret, EOK);
+-
+-    ret = sss_ncache_reset_users(ncache);
+-    assert_int_equal(ret, EOK);
+-
+-    ret = sss_ncache_reset_groups(ncache);
+-    assert_int_equal(ret, EOK);
+-
+-    ret = sss_ncache_check_uid(ncache, tc->dom, 2222);
+-    assert_int_equal(ret, ENOENT);
+-
+-    ret = sss_ncache_check_gid(ncache, tc->dom, 3333);
+-    assert_int_equal(ret, ENOENT);
+-
+-    /* the single ID filters are still there */
+-    ret = sss_ncache_check_uid(ncache, tc->dom, 1234);
+-    assert_int_equal(ret, EEXIST);
+-
+-    ret = check_uid_in_ncache(ncache, 65534);
+-    assert_int_equal(ret, EEXIST);
+-
+-    ret = sss_ncache_check_gid(ncache, tc->dom, 4321);
+-    assert_int_equal(ret, EEXIST);
+-
+-    /* and so are the real ranges */
+-    ret = check_uid_in_ncache(ncache, 500);
+-    assert_int_equal(ret, EEXIST);
+-
+-    ret = check_gid_in_ncache(ncache, 60005);
+-    assert_int_equal(ret, EEXIST);
+-
+-    /* Permanent reset drops the ranges along with the single entries */
+-    ret = sss_ncache_reset_permanent(ncache);
+-    assert_int_equal(ret, EOK);
+-
+-    ret = check_uid_in_ncache(ncache, 500);
+-    assert_int_equal(ret, ENOENT);
+-
+-    ret = check_gid_in_ncache(ncache, 60000);
+-    assert_int_equal(ret, ENOENT);
+-
+-    ret = sss_ncache_check_uid(ncache, tc->dom, 1234);
+-    assert_int_equal(ret, ENOENT);
+-
+-    /* ... and a repopulation brings them back */
+-    ret = sss_ncache_prepopulate(ncache, tc->confdb, ts->rctx);
+-    assert_int_equal(ret, EOK);
+-
+-    ret = check_uid_in_ncache(ncache, 500);
+-    assert_int_equal(ret, EEXIST);
+-
+-    ret = sss_ncache_check_gid(ncache, tc->dom, 4321);
+-    assert_int_equal(ret, EEXIST);
+ }
+ 
+ static void test_sss_ncache_default_domain_suffix(void **state)
+@@ -1073,7 +988,7 @@
+     ret = sss_names_init(ts, tc->confdb, TEST_DOM_NAME, &dom->names);
+     assert_int_equal(ret, EOK);
+ 
+-    ret = sss_ncache_reset_repopulate_permanent(ts->rctx, ncache);
++    ret = sss_ncache_reset(ts->rctx, ncache);
+     assert_int_equal(ret, EOK);
+ 
+     /* Add another domain */
+@@ -1096,7 +1011,7 @@
+     ret = check_group_in_ncache(ncache, dom2, "testgroup2");
+     assert_int_equal(ret, ENOENT);
+ 
+-    ret = sss_ncache_reset_repopulate_permanent(ts->rctx, ncache);
++    ret = sss_ncache_reset(ts->rctx, ncache);
+     assert_int_equal(ret, EOK);
+ 
+     /* First domain should not be known, the second not */
+@@ -1331,7 +1246,7 @@
+     ret = sss_names_init(ts, tc->confdb, TEST_DOM_NAME, &dom->names);
+     assert_int_equal(ret, EOK);
+ 
+-    ret = sss_ncache_reset_repopulate_permanent(ts->rctx, ncache);
++    ret = sss_ncache_reset(ts->rctx, ncache);
+     assert_int_equal(ret, EOK);
+ 
+     /* Add another domain */
+@@ -1345,7 +1260,7 @@
+     expect_in_parent(ncache, dom);
+     expect_no_entries_in_dom(ncache, dom2);
+ 
+-    ret = sss_ncache_reset_repopulate_permanent(ts->rctx, ncache);
++    ret = sss_ncache_reset(ts->rctx, ncache);
+     assert_int_equal(ret, EOK);
+ 
+     expect_in_parent(ncache, dom);
+@@ -1360,7 +1275,7 @@
+     dom->subdomains = sub_dom;
+     sub_dom->names = dom->names;
+ 
+-    ret = sss_ncache_reset_repopulate_permanent(ts->rctx, ncache);
++    ret = sss_ncache_reset(ts->rctx, ncache);
+     assert_int_equal(ret, EOK);
+ 
+     expect_in_parent(ncache, dom);
+@@ -1382,66 +1297,70 @@
+ {
+     errno_t ret;
+     struct test_state *ts;
++    struct tevent_context *ev;
++    struct sss_nc_ctx *ncache;
++    struct sss_test_ctx *tc;
+     struct sss_domain_info *dom;
++    struct sss_test_conf_param params[] = {
++        { NULL, NULL },
++    };
+ 
+     ts = talloc_get_type_abort(*state, struct test_state);
+-    dom = talloc(ts, struct sss_domain_info);
++
++    ev = tevent_context_init(ts);
++    assert_non_null(ev);
++
++    dom = talloc_zero(ts, struct sss_domain_info);
+     assert_non_null(dom);
++    dom->name = discard_const_p(char, TEST_DOM_NAME);
+     dom->case_sensitive = true;
+ 
+-    dom->name = discard_const_p(char, TEST_DOM_NAME);
++    ts->nctx = mock_nctx(ts);
++    assert_non_null(ts->nctx);
+ 
+-    /* Set users */
+-    ret = sss_ncache_check_uid(ts->ctx, NULL, 123);
+-    assert_int_equal(ret, ENOENT);
+-    ret = sss_ncache_set_uid(ts->ctx, false, NULL, 123);
+-    assert_int_equal(ret, EOK);
+-    ret = sss_ncache_check_uid(ts->ctx, NULL, 123);
+-    assert_int_equal(ret, EEXIST);
++    tc = create_dom_test_ctx(ts, TESTS_PATH, TEST_CONF_DB,
++                             TEST_DOM_NAME, TEST_ID_PROVIDER, params);
++    assert_non_null(tc);
+ 
+-    ret = sss_ncache_check_user(ts->ctx, dom, "foo");
+-    assert_int_equal(ret, ENOENT);
+-    ret = sss_ncache_set_user(ts->ctx, false, dom, "foo");
+-    assert_int_equal(ret, EOK);
+-    ret = sss_ncache_check_user(ts->ctx, dom, "foo");
+-    assert_int_equal(ret, EEXIST);
++    ncache = ts->ctx;
++    ts->rctx = mock_rctx(ts, ev, dom, ts->nctx);
++    assert_non_null(ts->rctx);
++    ts->rctx->cdb = tc->confdb;
+ 
+-    /* Set groups */
+-    ret = sss_ncache_check_gid(ts->ctx, NULL, 456);
+-    assert_int_equal(ret, ENOENT);
+-    ret = sss_ncache_set_gid(ts->ctx, false, NULL, 456);
++    ret = sss_names_init(ts, tc->confdb, TEST_DOM_NAME, &dom->names);
+     assert_int_equal(ret, EOK);
+-    ret = sss_ncache_check_gid(ts->ctx, NULL, 456);
+-    assert_int_equal(ret, EEXIST);
+ 
+-    ret = sss_ncache_check_group(ts->ctx, dom, "bar");
+-    assert_int_equal(ret, ENOENT);
+-    ret = sss_ncache_set_group(ts->ctx, false, dom, "bar");
++    /* Populate non-permanent entries of several kinds */
++    ret = sss_ncache_set_uid(ncache, false, NULL, 123);
+     assert_int_equal(ret, EOK);
+-    ret = sss_ncache_check_group(ts->ctx, dom, "bar");
+-    assert_int_equal(ret, EEXIST);
+-
+-    ret = sss_ncache_reset_users(ts->ctx);
++    ret = sss_ncache_set_user(ncache, false, dom, "foo");
++    assert_int_equal(ret, EOK);
++    ret = sss_ncache_set_gid(ncache, false, NULL, 456);
++    assert_int_equal(ret, EOK);
++    ret = sss_ncache_set_group(ncache, false, dom, "bar");
+     assert_int_equal(ret, EOK);
+ 
+-    /* Users are no longer negatively cached */
+-    ret = sss_ncache_check_user(ts->ctx, dom, "foo");
+-    assert_int_equal(ret, ENOENT);
+-    ret = sss_ncache_check_uid(ts->ctx, NULL, 123);
+-    assert_int_equal(ret, ENOENT);
+-
+-    /* Groups still are */
+-    ret = sss_ncache_check_gid(ts->ctx, NULL, 456);
++    ret = sss_ncache_check_uid(ncache, NULL, 123);
++    assert_int_equal(ret, EEXIST);
++    ret = sss_ncache_check_user(ncache, dom, "foo");
++    assert_int_equal(ret, EEXIST);
++    ret = sss_ncache_check_gid(ncache, NULL, 456);
+     assert_int_equal(ret, EEXIST);
+-    ret = sss_ncache_check_group(ts->ctx, dom, "bar");
++    ret = sss_ncache_check_group(ncache, dom, "bar");
+     assert_int_equal(ret, EEXIST);
+ 
+-    ret = sss_ncache_reset_groups(ts->ctx);
++    /* A reset recreates the cache from scratch: every non-permanent entry,
++     * regardless of kind, is dropped at once. */
++    ret = sss_ncache_reset(ts->rctx, ncache);
+     assert_int_equal(ret, EOK);
+ 
+-    ret = sss_ncache_check_gid(ts->ctx, NULL, 456);
++    ret = sss_ncache_check_uid(ncache, NULL, 123);
+     assert_int_equal(ret, ENOENT);
+-    ret = sss_ncache_check_group(ts->ctx, dom, "bar");
++    ret = sss_ncache_check_user(ncache, dom, "foo");
++    assert_int_equal(ret, ENOENT);
++    ret = sss_ncache_check_gid(ncache, NULL, 456);
++    assert_int_equal(ret, ENOENT);
++    ret = sss_ncache_check_group(ncache, dom, "bar");
+     assert_int_equal(ret, ENOENT);
+ }
+ 
+@@ -1541,8 +1460,6 @@
+                                         teardown),
+         cmocka_unit_test_setup_teardown(test_sss_ncache_service_port,
+                                         setup, teardown),
+-        cmocka_unit_test_setup_teardown(test_sss_ncache_reset_permanent, setup,
+-                                        teardown),
+         cmocka_unit_test_setup_teardown(test_sss_ncache_prepopulate,
+                                         setup, teardown),
+         cmocka_unit_test_setup_teardown(test_sss_ncache_prepopulate_filter_ids,
+--- a/src/tests/cmocka/test_responder_common.c
++++ b/src/tests/cmocka/test_responder_common.c
+@@ -244,8 +244,8 @@
+     struct parse_inp_test_ctx *pctx;
+ };
+ 
+-errno_t __wrap_sss_ncache_reset_repopulate_permanent(struct resp_ctx *rctx,
+-                                                     struct sss_nc_ctx *dummy_ncache_ptr)
++errno_t __wrap_sss_ncache_reset(struct resp_ctx *rctx,
++                                struct sss_nc_ctx *dummy_ncache_ptr)
+ {
+     test_ev_done(dummy_ncache_ptr->pctx->tctx, EOK);
+     return EOK;


=====================================
debian/patches/CVE-2026-104041-2.diff
=====================================
@@ -0,0 +1,368 @@
+From 5b54a9cb3118ec648d29ada8a8701a1db9ad2805 Mon Sep 17 00:00:00 2001
+From: Alexey Tikhonov <atikhono at redhat.com>
+Date: Mon, 2 Nov 2026 16:48:46 +0100
+Subject: [PATCH] negcache: limit max mem size consumed by negative cache
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+:fixes: CVE-2026-104041
+
+Resolves: https://github.com/SSSD/sssd/issues/4658
+
+Assisted-By: Claude Code (Opus 4.8)
+Reviewed-by: Alejandro López <allopez at redhat.com>
+Reviewed-by: Pavel Březina <pbrezina at redhat.com>
+---
+ src/confdb/confdb.h                         |  2 +
+ src/config/cfg_rules.ini                    |  1 +
+ src/responder/common/negcache.c             | 59 +++++++++++++++------
+ src/responder/common/negcache.h             |  3 +-
+ src/responder/common/responder_common.c     | 22 +++++++-
+ src/tests/cmocka/common_mock_resp.c         |  2 +-
+ src/tests/cmocka/test_negcache.c            |  4 +-
+ src/tests/cmocka/test_negcache_2.c          | 16 +++---
+ src/tests/cmocka/test_responder_cache_req.c |  6 +--
+ 9 files changed, 83 insertions(+), 32 deletions(-)
+
+--- a/src/confdb/confdb.h
++++ b/src/confdb/confdb.h
+@@ -100,6 +100,8 @@
+ #define CONFDB_NSS_ENUM_CACHE_TIMEOUT "enum_cache_timeout"
+ #define CONFDB_NSS_ENTRY_CACHE_NOWAIT_PERCENTAGE "entry_cache_nowait_percentage"
+ #define CONFDB_NSS_ENTRY_NEG_TIMEOUT "entry_negative_timeout"
++#define CONFDB_NSS_ENTRY_NEG_CACHE_MAX_SIZE "entry_negative_cache_max_size"  /* Undocumented on purpose */
++#define CONFDB_NSS_ENTRY_NEG_CACHE_DEFAULT_MAX_SIZE (1024 * 1024)
+ #define CONFDB_NSS_FILTER_USERS_IN_GROUPS "filter_users_in_groups"
+ #define CONFDB_NSS_FILTER_USERS "filter_users"
+ #define CONFDB_NSS_FILTER_GROUPS "filter_groups"
+--- a/src/config/cfg_rules.ini
++++ b/src/config/cfg_rules.ini
+@@ -79,6 +79,7 @@
+ option = enum_cache_timeout
+ option = entry_cache_nowait_percentage
+ option = entry_negative_timeout
++option = entry_negative_cache_max_size
+ option = filter_users
+ option = filter_groups
+ option = filter_uids
+--- a/src/responder/common/negcache.c
++++ b/src/responder/common/negcache.c
+@@ -59,6 +59,15 @@
+ struct sss_nc_ctx {
+     struct tdb_context *tdb;
+     uint32_t timeout;
++    /* Responder context used to repopulate the permanent entries.
++     * Set by the first `sss_ncache_prepopulate()` */
++    struct resp_ctx *rctx;
++    /* tdb map size occupied by the permanent entries */
++    size_t base_map_size;
++    /* how many bytes the cache may grow past base_map_size before it is
++     * recreated; 0 disables the limit (see the undocumented
++     * CONFDB_NSS_ENTRY_NEG_CACHE_MAX_SIZE option) */
++    size_t max_map_size;
+     struct sss_nc_id_range *uid_ranges;
+     struct sss_nc_id_range *gid_ranges;
+ };
+@@ -88,7 +97,7 @@
+ }
+ 
+ int sss_ncache_init(TALLOC_CTX *memctx, uint32_t timeout,
+-                    struct sss_nc_ctx **_ctx)
++                    size_t max_map_size, struct sss_nc_ctx **_ctx)
+ {
+     struct sss_nc_ctx *ctx;
+ 
+@@ -99,6 +108,7 @@
+     if (!ctx->tdb) return errno;
+ 
+     ctx->timeout = timeout;
++    ctx->max_map_size = max_map_size;
+ 
+     *_ctx = ctx;
+     return EOK;
+@@ -114,7 +124,6 @@
+     TDB_DATA key;
+     TDB_DATA data;
+     unsigned long long int timestamp;
+-    bool expired = false;
+     char *ep;
+     int ret;
+ 
+@@ -123,20 +132,22 @@
+     data.dptr = NULL;
+ 
+     ret = string_to_tdb_data(str, &key);
+-    if (ret != EOK) goto done;
++    if (ret != EOK) {
++        return ret;
++    }
+ 
+     data = tdb_fetch(ctx->tdb, key);
+-
+     if (!data.dptr) {
+-        ret = ENOENT;
+-        goto done;
++        return ENOENT;
+     }
+ 
+     errno = 0;
+     timestamp = strtoull((const char *)data.dptr, &ep, 10);
+     if (errno != 0 || *ep != '\0') {
+-        /* Malformed entry, remove it and return no entry */
+-        expired = true;
++        /* Malformed entry, treat it as absent. Expired and malformed entries
++         * are not evicted individually; they are flushed when the cache is
++         * recreated. */
++        ret = ENOENT;
+         goto done;
+     }
+ 
+@@ -152,15 +163,10 @@
+         goto done;
+     }
+ 
+-    expired = true;
++    /* expired, report as absent but leave it in place */
++    ret = ENOENT;
+ 
+ done:
+-    if (expired) {
+-        /* expired, remove and return no entry */
+-        tdb_delete(ctx->tdb, key);
+-        ret = ENOENT;
+-    }
+-
+     free(data.dptr);
+     return ret;
+ }
+@@ -191,6 +197,22 @@
+     ret = string_to_tdb_data(timest, &data);
+     if (ret != EOK) goto done;
+ 
++    /* Keep the cache bounded: deleting entries does not shrink the tdb map,
++     * so once the limit is hit, recreate it from scratch. */
++    if (!permanent && ctx->rctx != NULL && ctx->max_map_size != 0
++            && tdb_map_size(ctx->tdb) > ctx->base_map_size + ctx->max_map_size) {
++        DEBUG(SSSDBG_IMPORTANT_INFO,
++              "Negative cache grew %zu bytes past its baseline, recreating it\n",
++              ctx->max_map_size);
++        ret = sss_ncache_reset(ctx->rctx, ctx);
++        if (ret != EOK) {
++            DEBUG(SSSDBG_CRIT_FAILURE,
++                  "Failed to recreate the negative cache [%d]: %s\n",
++                  ret, sss_strerror(ret));
++            goto done;
++        }
++    }
++
+     DEBUG(SSSDBG_TRACE_FUNC, "Adding [%s] to negative cache%s\n",
+               str, permanent?" permanently":"");
+ 
+@@ -1196,6 +1218,10 @@
+         return ENOMEM;
+     }
+ 
++    /* Remember the responder context so the cache can be recreated later (on
++     * reset or when it grows past max_map_size). */
++    ncache->rctx = rctx;
++
+     /* Populate domain-specific negative cache user entries */
+     for (dom = domain_list; dom; dom = get_next_domain(dom, 0)) {
+         conf_path = talloc_asprintf(tmpctx, CONFDB_DOMAIN_PATH_TMPL,
+@@ -1560,6 +1586,9 @@
+               ret, strerror(ret));
+     }
+ 
++    /* Record the footprint of the permanent entries */
++    ncache->base_map_size = tdb_map_size(ncache->tdb);
++
+     ret = EOK;
+ 
+ done:
+--- a/src/responder/common/negcache.h
++++ b/src/responder/common/negcache.h
+@@ -24,9 +24,8 @@
+ 
+ struct sss_nc_ctx;
+ 
+-/* init the in memory negative cache */
+ int sss_ncache_init(TALLOC_CTX *memctx, uint32_t timeout,
+-                    struct sss_nc_ctx **_ctx);
++                    size_t max_map_size, struct sss_nc_ctx **_ctx);
+ 
+ uint32_t sss_ncache_get_timeout(struct sss_nc_ctx *ctx);
+ 
+--- a/src/responder/common/responder_common.c
++++ b/src/responder/common/responder_common.c
+@@ -999,6 +999,7 @@
+                                      struct sss_nc_ctx **ncache)
+ {
+     uint32_t neg_timeout;
++    size_t max_map_size;
+     int tmp_value;
+     int ret;
+ 
+@@ -1021,8 +1022,27 @@
+ 
+     neg_timeout = tmp_value;
+ 
++    /* max_map_size (undocumented on purpose) */
++    ret = confdb_get_int(cdb, CONFDB_NSS_CONF_ENTRY,
++                         CONFDB_NSS_ENTRY_NEG_CACHE_MAX_SIZE,
++                         CONFDB_NSS_ENTRY_NEG_CACHE_DEFAULT_MAX_SIZE, &tmp_value);
++    if (ret != EOK) {
++        DEBUG(SSSDBG_FATAL_FAILURE,
++              "Fatal failure of setup negative cache size limit [%s].\n",
++              CONFDB_NSS_ENTRY_NEG_CACHE_MAX_SIZE);
++        ret = ENOENT;
++        goto done;
++    }
++
++    if (tmp_value < 0) {
++        ret = EINVAL;
++        goto done;
++    }
++
++    max_map_size = tmp_value;
++
+     /* negative cache init */
+-    ret = sss_ncache_init(mem_ctx, neg_timeout, ncache);
++    ret = sss_ncache_init(mem_ctx, neg_timeout, max_map_size, ncache);
+     if (ret != EOK) {
+         DEBUG(SSSDBG_FATAL_FAILURE,
+               "Fatal failure of initializing negative cache.\n");
+--- a/src/tests/cmocka/common_mock_resp.c
++++ b/src/tests/cmocka/common_mock_resp.c
+@@ -36,7 +36,7 @@
+     rctx = talloc_zero(mem_ctx, struct resp_ctx);
+     if (!rctx) return NULL;
+ 
+-    ret = sss_ncache_init(rctx, 10, &rctx->ncache);
++    ret = sss_ncache_init(rctx, 10, 0, &rctx->ncache);
+     if (ret != EOK) {
+         talloc_free(rctx);
+         return NULL;
+--- a/src/tests/cmocka/test_negcache.c
++++ b/src/tests/cmocka/test_negcache.c
+@@ -117,7 +117,7 @@
+     ts = talloc(NULL, struct test_state);
+     assert_non_null(ts);
+ 
+-    ret = sss_ncache_init(ts, SHORTSPAN, &ts->ctx);
++    ret = sss_ncache_init(ts, SHORTSPAN, 0, &ts->ctx);
+     assert_int_equal(ret, EOK);
+     assert_non_null(ts->ctx);
+ 
+@@ -142,7 +142,7 @@
+     memctx = talloc_new(NULL);
+     assert_non_null(memctx);
+ 
+-    ret = sss_ncache_init(memctx, SHORTSPAN, &ctx);
++    ret = sss_ncache_init(memctx, SHORTSPAN, 0, &ctx);
+     assert_int_equal(ret, EOK);
+     assert_non_null(ctx);
+ 
+--- a/src/tests/cmocka/test_negcache_2.c
++++ b/src/tests/cmocka/test_negcache_2.c
+@@ -364,7 +364,7 @@
+     test_ctx = talloc_get_type_abort(*state, struct ncache_test_ctx);
+     assert_non_null(test_ctx);
+ 
+-    ret = sss_ncache_init(test_ctx, 0, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, 0, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     set_users(test_ctx);
+@@ -384,7 +384,7 @@
+     test_ctx = talloc_get_type_abort(*state, struct ncache_test_ctx);
+     assert_non_null(test_ctx);
+ 
+-    ret = sss_ncache_init(test_ctx, TIMEOUT, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, TIMEOUT, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     set_users(test_ctx);
+@@ -441,7 +441,7 @@
+     test_ctx = talloc_get_type_abort(*state, struct ncache_test_ctx);
+     assert_non_null(test_ctx);
+ 
+-    ret = sss_ncache_init(test_ctx, 0, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, 0, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     set_uids(test_ctx);
+@@ -461,7 +461,7 @@
+     test_ctx = talloc_get_type_abort(*state, struct ncache_test_ctx);
+     assert_non_null(test_ctx);
+ 
+-    ret = sss_ncache_init(test_ctx, TIMEOUT, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, TIMEOUT, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     set_uids(test_ctx);
+@@ -520,7 +520,7 @@
+     test_ctx = talloc_get_type_abort(*state, struct ncache_test_ctx);
+     assert_non_null(test_ctx);
+ 
+-    ret = sss_ncache_init(test_ctx, 0, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, 0, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     set_groups(test_ctx);
+@@ -540,7 +540,7 @@
+     test_ctx = talloc_get_type_abort(*state, struct ncache_test_ctx);
+     assert_non_null(test_ctx);
+ 
+-    ret = sss_ncache_init(test_ctx, TIMEOUT, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, TIMEOUT, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     set_groups(test_ctx);
+@@ -597,7 +597,7 @@
+     test_ctx = talloc_get_type_abort(*state, struct ncache_test_ctx);
+     assert_non_null(test_ctx);
+ 
+-    ret = sss_ncache_init(test_ctx, 0, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, 0, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     set_gids(test_ctx);
+@@ -617,7 +617,7 @@
+     test_ctx = talloc_get_type_abort(*state, struct ncache_test_ctx);
+     assert_non_null(test_ctx);
+ 
+-    ret = sss_ncache_init(test_ctx, TIMEOUT, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, TIMEOUT, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     set_gids(test_ctx);
+--- a/src/tests/cmocka/test_responder_cache_req.c
++++ b/src/tests/cmocka/test_responder_cache_req.c
+@@ -590,7 +590,7 @@
+                                test_ctx->tctx->dom, NULL);
+     assert_non_null(test_ctx->rctx);
+ 
+-    ret = sss_ncache_init(test_ctx, 10, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, 10, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     check_leaks_push(test_ctx);
+@@ -650,7 +650,7 @@
+                                test_ctx->tctx->dom, NULL);
+     assert_non_null(test_ctx->rctx);
+ 
+-    ret = sss_ncache_init(test_ctx, 10, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, 10, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     reset_ldb_errstrings(test_ctx->tctx->dom);
+@@ -723,7 +723,7 @@
+                                test_ctx->tctx->dom, NULL);
+     assert_non_null(test_ctx->rctx);
+ 
+-    ret = sss_ncache_init(test_ctx, 10, &test_ctx->ncache);
++    ret = sss_ncache_init(test_ctx, 10, 0, &test_ctx->ncache);
+     assert_int_equal(ret, EOK);
+ 
+     test_ctx->subdomain = new_subdomain(test_ctx, test_ctx->tctx->dom,


=====================================
debian/patches/CVE-2026-104041_pre_NSS-Add-options-to-exclude-UID-and-GID.diff
=====================================
@@ -0,0 +1,914 @@
+From 0b2632bdb745dbdba2c91b24e2853770ed721305 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alejandro=20L=C3=B3pez?= <allopez at redhat.com>
+Date: Tue, 20 Oct 2026 14:27:58 +0200
+Subject: [PATCH] NSS: Add options to exclude UID and GID
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+:feature: UIDs and GIDs mentioned in the new options filter_uids and
+  filter_gids will make SSSD avoid the LDAP search and just say that
+  they don't exist. They are comma-separated lists of simple values or
+  ranges:
+  filter_uids = 0-999, 1234, 2000-2099
+
+Assisted-By: Claude Code (Opus 5)
+Reviewed-by: Alexey Tikhonov <atikhono at redhat.com>
+Reviewed-by: Pavel Březina <pbrezina at redhat.com>
+---
+ src/confdb/confdb.h                  |   2 +
+ src/config/SSSDConfig/sssdoptions.py |   2 +
+ src/config/SSSDConfigTest.py         |   4 +
+ src/config/cfg_rules.ini             |   4 +
+ src/config/etc/sssd.api.conf         |   4 +
+ src/man/sssd.conf.5.xml              |  61 ++++-
+ src/responder/common/negcache.c      | 327 +++++++++++++++++++++++++++
+ src/responder/common/negcache.h      |   4 +-
+ src/tests/cmocka/test_negcache.c     | 197 ++++++++++++++++
+ src/tests/system/tests/test_nss.py   | 106 +++++++++
+ 10 files changed, 708 insertions(+), 3 deletions(-)
+
+--- a/src/confdb/confdb.h
++++ b/src/confdb/confdb.h
+@@ -103,6 +103,8 @@
+ #define CONFDB_NSS_FILTER_USERS_IN_GROUPS "filter_users_in_groups"
+ #define CONFDB_NSS_FILTER_USERS "filter_users"
+ #define CONFDB_NSS_FILTER_GROUPS "filter_groups"
++#define CONFDB_NSS_FILTER_UIDS "filter_uids"
++#define CONFDB_NSS_FILTER_GIDS "filter_gids"
+ #define CONFDB_NSS_PWFIELD  "pwfield"
+ #define CONFDB_NSS_OVERRIDE_HOMEDIR "override_homedir"
+ #define CONFDB_NSS_FALLBACK_HOMEDIR "fallback_homedir"
+--- a/src/config/SSSDConfig/sssdoptions.py
++++ b/src/config/SSSDConfig/sssdoptions.py
+@@ -58,6 +58,8 @@
+         'enum_cache_timeout': _('Enumeration cache timeout length (seconds)'),
+         'entry_cache_no_wait_timeout': _('Entry cache background update timeout length (seconds)'),
+         'entry_negative_timeout': _('Negative cache timeout length (seconds)'),
++        'filter_uids': _('UIDs or UID ranges that SSSD should explicitly ignore'),
++        'filter_gids': _('GIDs or GID ranges that SSSD should explicitly ignore'),
+         'filter_users': _('Users that SSSD should explicitly ignore'),
+         'filter_groups': _('Groups that SSSD should explicitly ignore'),
+         'filter_users_in_groups': _('Should filtered users appear in groups'),
+--- a/src/config/SSSDConfigTest.py
++++ b/src/config/SSSDConfigTest.py
+@@ -540,6 +540,8 @@
+             'ignore_group_members',
+             'filter_users',
+             'filter_groups',
++            'filter_uids',
++            'filter_gids',
+             'entry_cache_timeout',
+             'entry_cache_user_timeout',
+             'entry_cache_group_timeout',
+@@ -907,6 +909,8 @@
+             'ignore_group_members',
+             'filter_users',
+             'filter_groups',
++            'filter_uids',
++            'filter_gids',
+             'entry_cache_timeout',
+             'entry_cache_user_timeout',
+             'entry_cache_group_timeout',
+--- a/src/config/cfg_rules.ini
++++ b/src/config/cfg_rules.ini
+@@ -81,6 +81,8 @@
+ option = entry_negative_timeout
+ option = filter_users
+ option = filter_groups
++option = filter_uids
++option = filter_gids
+ option = filter_users_in_groups
+ option = pwfield
+ option = override_homedir
+@@ -390,6 +392,8 @@
+ option = pwd_expiration_warning
+ option = filter_users
+ option = filter_groups
++option = filter_uids
++option = filter_gids
+ option = dns_resolver_server_timeout
+ option = dns_resolver_op_timeout
+ option = dns_resolver_timeout
+--- a/src/config/etc/sssd.api.conf
++++ b/src/config/etc/sssd.api.conf
+@@ -41,6 +41,8 @@
+ enum_cache_timeout = int, None, false
+ entry_cache_nowait_percentage = int, None, false
+ entry_negative_timeout = int, None, false
++filter_uids = list, str, false
++filter_gids = list, str, false
+ filter_users = list, str, false
+ filter_groups = list, str, false
+ filter_users_in_groups = bool, None, false
+@@ -165,6 +167,8 @@
+ lookup_family_order = str, None, false
+ account_cache_expiration = int, None, false
+ pwd_expiration_warning = int, None, false
++filter_uids = list, str, false
++filter_gids = list, str, false
+ filter_users = list, str, false
+ filter_groups = list, str, false
+ dns_resolver_server_timeout = int, None, false
+--- a/src/man/sssd.conf.5.xml
++++ b/src/man/sssd.conf.5.xml
+@@ -873,7 +873,66 @@
+                             users of the latter listed.
+                         </para>
+                         <para>
+-                            Default: root
++                            NOTE: Please be aware that these options will only
++                            filter request on the user or group name, but not
++                            on the UID or GID. If you also need to filter the
++                            UID or GID, you have to set <quote>filter_uids</quote>
++                            or <quote>filter_gids</quote> too.
++                        </para>
++                        <para>
++                            Default: Not set.
++                        </para>
++                        <para>
++                            NOTE: The root user and group are always filtered out
++                            regardless of this option.
++                        </para>
++                    </listitem>
++                </varlistentry>
++                <varlistentry>
++                    <term>filter_uids, filter_gids (string)</term>
++                    <listitem>
++                        <para>
++                            Exclude certain UIDs or GIDs from being fetched
++                            from the sss NSS database. Requests for a filtered
++                            ID are answered immediately with "not found",
++                            without querying the back end at all, which avoids
++                            the latency and the directory server load caused
++                            by lookups for IDs known never to exist there,
++                            such as the ones of local system accounts.
++                        </para>
++                        <para>
++                            Each value is either a single ID or an inclusive
++                            range written as <quote>MIN-MAX</quote> (spaces
++                            not allowed around the '-'). This option can also
++                            be set per-domain, in which case it applies to that
++                            domain and its sub-domains only.
++                        </para>
++                        <para>
++                            NOTE: As with <quote>filter_groups</quote>,
++                            filtering a GID doesn't affect inheritance of nested
++                            group members, since filtering happens after they are
++                            propagated for returning via NSS.
++                        </para>
++                        <para>
++                            NOTE: These options will only filter request on the
++                            UID or GID, but not on the name. If you also need to
++                            filter the name, you have to set
++                            <quote>filter_users</quote> or
++                            <quote>filter_groups</quote> too.
++                        </para>
++                        <para>
++                            Example:
++                            <programlisting>
++filter_uids = 0-999, 65534
++filter_gids = 0-999, 65534
++                            </programlisting>
++                        </para>
++                        <para>
++                            Default: Not set.
++                        </para>
++                        <para>
++                            NOTE: The 0 user and group are always filtered out
++                            regardless of this option.
+                         </para>
+                     </listitem>
+                 </varlistentry>
+--- a/src/responder/common/negcache.c
++++ b/src/responder/common/negcache.c
+@@ -19,10 +19,12 @@
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+ 
++#include <ctype.h>
+ #include <fcntl.h>
+ #include <time.h>
+ #include "tdb.h"
+ #include "util/util.h"
++#include "util/strtonum.h"
+ #include "util/nss_dl_load.h"
+ #include "confdb/confdb.h"
+ #include "responder/common/responder.h"
+@@ -41,9 +43,24 @@
+ #define NC_DOMAIN_ACCT_LOCATE_PREFIX NC_ENTRY_PREFIX"DOM_LOCATE"
+ #define NC_DOMAIN_ACCT_LOCATE_TYPE_PREFIX NC_ENTRY_PREFIX"DOM_LOCATE_TYPE"
+ 
++/* Permanently filtered out ID range, as configured by filter_uids and
++ * filter_gids. Ranges are kept in a plain list instead of being expanded into
++ * one tdb entry per ID, so that a range as wide as "1000-60000" costs a single
++ * entry. A range holding a single ID is not kept here at all: it is stored as
++ * a permanent tdb entry, exactly like a name coming from filter_users. */
++struct sss_nc_id_range {
++    struct sss_nc_id_range *prev;
++    struct sss_nc_id_range *next;
++    const char *dom_name; /* NULL for the domain independent entries */
++    uint32_t min;
++    uint32_t max;
++};
++
+ struct sss_nc_ctx {
+     struct tdb_context *tdb;
+     uint32_t timeout;
++    struct sss_nc_id_range *uid_ranges;
++    struct sss_nc_id_range *gid_ranges;
+ };
+ 
+ typedef int (*ncache_set_byname_fn_t)(struct sss_nc_ctx *, bool,
+@@ -399,12 +416,114 @@
+ 
+ 
+ 
++/* Check the permanently filtered out ranges. The domain scoping mirrors the
++ * one of the tdb keys: a range set for a specific domain only matches a lookup
++ * in that very domain, a domain independent range only matches a domain
++ * independent lookup. Callers interested in both do the two calls, the same
++ * way they already do for the single-ID entries. */
++static bool sss_ncache_check_id_range(const struct sss_nc_id_range *ranges,
++                                      const struct sss_domain_info *dom,
++                                      uint32_t id)
++{
++    struct sss_nc_id_range *range;
++
++    DLIST_FOR_EACH(range, discard_const(ranges)) {
++        if ((dom == NULL) != (range->dom_name == NULL)) {
++            continue;
++        }
++
++        if (id < range->min || id > range->max) {
++            continue;
++        }
++
++        if (dom == NULL || strcmp(dom->name, range->dom_name) == 0) {
++            return true;
++        }
++    }
++
++    return false;
++}
++
++static int sss_ncache_set_id_range(TALLOC_CTX *memctx,
++                                   struct sss_nc_id_range **ranges,
++                                   struct sss_domain_info *dom,
++                                   uint32_t min, uint32_t max)
++{
++    struct sss_nc_id_range *range;
++
++    if (min > max) {
++        return EINVAL;
++    }
++
++    range = talloc_zero(memctx, struct sss_nc_id_range);
++    if (range == NULL) {
++        return ENOMEM;
++    }
++
++    if (dom != NULL) {
++        range->dom_name = talloc_strdup(range, dom->name);
++        if (range->dom_name == NULL) {
++            talloc_free(range);
++            return ENOMEM;
++        }
++    }
++
++    range->min = min;
++    range->max = max;
++
++    DLIST_ADD(*ranges, range);
++
++    return EOK;
++}
++
++static void sss_ncache_free_id_ranges(struct sss_nc_id_range **ranges)
++{
++    struct sss_nc_id_range *range;
++
++    while (*ranges != NULL) {
++        range = *ranges;
++        DLIST_REMOVE(*ranges, range);
++        talloc_free(range);
++    }
++}
++
++static int sss_ncache_set_uid_range(struct sss_nc_ctx *ctx,
++                             struct sss_domain_info *dom,
++                             uid_t min, uid_t max)
++{
++    if (min == max) {
++        /* A single ID is stored as a plain permanent entry, the same way a
++         * name coming from filter_users is. The hash lookup is cheaper than
++         * walking the range list and sss_ncache_reset_permanent() flushes
++         * the entry for free. */
++        return sss_ncache_set_uid(ctx, true, dom, min);
++    }
++
++    return sss_ncache_set_id_range(ctx, &ctx->uid_ranges, dom, min, max);
++}
++
++static int sss_ncache_set_gid_range(struct sss_nc_ctx *ctx,
++                             struct sss_domain_info *dom,
++                             gid_t min, gid_t max)
++{
++    if (min == max) {
++        /* see sss_ncache_set_uid_range() */
++        return sss_ncache_set_gid(ctx, true, dom, min);
++    }
++
++    return sss_ncache_set_id_range(ctx, &ctx->gid_ranges, dom, min, max);
++}
++
+ int sss_ncache_check_uid(struct sss_nc_ctx *ctx, struct sss_domain_info *dom,
+                          uid_t uid)
+ {
+     char *str;
+     int ret;
+ 
++    if (sss_ncache_check_id_range(ctx->uid_ranges, dom, uid)) {
++        return EEXIST;
++    }
++
+     if (dom != NULL) {
+         str = talloc_asprintf(ctx, "%s/%s/%"SPRIuid, NC_UID_PREFIX, dom->name,
+                               uid);
+@@ -425,6 +544,10 @@
+     char *str;
+     int ret;
+ 
++    if (sss_ncache_check_id_range(ctx->gid_ranges, dom, gid)) {
++        return EEXIST;
++    }
++
+     if (dom != NULL) {
+         str = talloc_asprintf(ctx, "%s/%s/%"SPRIgid, NC_GID_PREFIX, dom->name,
+                               gid);
+@@ -903,6 +1026,9 @@
+     if (ret < 0)
+         return EIO;
+ 
++    sss_ncache_free_id_ranges(&ctx->uid_ranges);
++    sss_ncache_free_id_ranges(&ctx->gid_ranges);
++
+     return EOK;
+ }
+ 
+@@ -971,6 +1097,192 @@
+     return sss_ncache_reset_pfx(ctx, prefixes);
+ }
+ 
++/* Parse a single filter_uids/filter_gids value, either a plain "ID" or an
++ * inclusive "MIN-MAX" range. */
++static errno_t sss_ncache_parse_id_filter(const char *value,
++                                          uint32_t *_min, uint32_t *_max)
++{
++    uint32_t min;
++    uint32_t max;
++    char *endptr;
++
++    /* strtouint32() would silently accept a sign, and a leading separator
++     * would make an empty boundary look like a valid 0. */
++    if (!isdigit((unsigned char)value[0])) {
++        return EINVAL;
++    }
++
++    min = strtouint32(value, &endptr, 10);
++    if (errno != 0) {
++        return EINVAL;
++    }
++
++    if (*endptr == '\0') {
++        max = min;
++    } else if (*endptr == '-') {
++        value = endptr + 1;
++        if (!isdigit((unsigned char)value[0])) {
++            return EINVAL;
++        }
++
++        max = strtouint32(value, &endptr, 10);
++        if (errno != 0 || *endptr != '\0') {
++            return EINVAL;
++        }
++
++        if (max < min) {
++            return EINVAL;
++        }
++    } else {
++        return EINVAL;
++    }
++
++    *_min = min;
++    *_max = max;
++
++    return EOK;
++}
++
++typedef int (*ncache_set_id_range_fn_t)(struct sss_nc_ctx *ctx,
++                                        struct sss_domain_info *dom,
++                                        uint32_t min, uint32_t max);
++
++/* Read one filter_uids/filter_gids list and hand every entry to the setter.
++ * A malformed entry is reported and skipped, the same way filter_users deals
++ * with an unparsable name. */
++static errno_t sss_ncache_prepopulate_id_list(struct sss_nc_ctx *ncache,
++                                              struct confdb_ctx *cdb,
++                                              const char *conf_path,
++                                              const char *option,
++                                              struct sss_domain_info *dom,
++                                              ncache_set_id_range_fn_t setter)
++{
++    TALLOC_CTX *tmp_ctx;
++    char **filter_list = NULL;
++    uint32_t min;
++    uint32_t max;
++    errno_t ret;
++    int i;
++
++    tmp_ctx = talloc_new(NULL);
++    if (tmp_ctx == NULL) {
++        return ENOMEM;
++    }
++
++    ret = confdb_get_string_as_list(cdb, tmp_ctx, conf_path, option,
++                                    &filter_list);
++    if (ret == ENOENT) {
++        ret = EOK;
++        goto done;
++    } else if (ret != EOK) {
++        goto done;
++    }
++
++    for (i = 0; filter_list[i] != NULL; i++) {
++        ret = sss_ncache_parse_id_filter(filter_list[i], &min, &max);
++        if (ret != EOK) {
++            DEBUG(SSSDBG_CRIT_FAILURE,
++                  "Invalid value in %s list: [%s], expecting an ID or an "
++                  "ID range such as [1-999], skipping\n",
++                  option, filter_list[i]);
++            continue;
++        }
++
++        ret = setter(ncache, dom, min, max);
++        if (ret != EOK) {
++            DEBUG(SSSDBG_CRIT_FAILURE,
++                  "Failed to store permanent %s filter for [%s] (%d [%s])\n",
++                  option, filter_list[i], ret, sss_strerror(ret));
++            continue;
++        }
++
++        if (min != max) {
++            /* If min == max, the entry was not created as a range and
++             * is already logged. */
++            DEBUG(SSSDBG_TRACE_FUNC,
++                  "Added %s range [%"PRIu32"-%"PRIu32"] to the negative cache "
++                  "of [%s]\n", option, min, max,
++                  dom == NULL ? "all domains" : dom->name);
++        }
++    }
++
++    ret = EOK;
++
++done:
++    talloc_free(tmp_ctx);
++    return ret;
++}
++
++/* Populate the negative cache from filter_uids/filter_gids, both from the
++ * domain sections and from the domain independent [nss] one. */
++static errno_t sss_ncache_prepopulate_ids(struct sss_nc_ctx *ncache,
++                                          struct confdb_ctx *cdb,
++                                          struct sss_domain_info *domain_list,
++                                          const char *option,
++                                          ncache_set_id_range_fn_t setter)
++{
++    TALLOC_CTX *tmp_ctx;
++    struct sss_domain_info *dom;
++    struct sss_domain_info *ddom;
++    char *conf_path;
++    errno_t ret;
++
++    tmp_ctx = talloc_new(NULL);
++    if (tmp_ctx == NULL) {
++        return ENOMEM;
++    }
++
++    for (dom = domain_list; dom != NULL; dom = get_next_domain(dom, 0)) {
++        conf_path = talloc_asprintf(tmp_ctx, CONFDB_DOMAIN_PATH_TMPL,
++                                    dom->name);
++        if (conf_path == NULL) {
++            ret = ENOMEM;
++            goto done;
++        }
++
++        /* An ID filter set on a domain covers its sub-domains as well, just
++         * like filter_users and filter_groups do. */
++        for (ddom = dom; ddom != NULL;
++                    ddom = get_next_domain(ddom, SSS_GND_ALL_SUBDOMAINS)) {
++            ret = sss_ncache_prepopulate_id_list(ncache, cdb, conf_path,
++                                                 option, ddom, setter);
++            if (ret != EOK) {
++                goto done;
++            }
++        }
++
++        talloc_free(conf_path);
++    }
++
++    /* The domain independent list is registered both as a domain independent
++     * entry and once per domain, the same way filter_users and filter_groups
++     * fan their [nss] list out over every domain. A domain independent entry
++     * on its own would not be enough: while the ID requests do fall back to a
++     * lookup with a NULL domain, is_group_filtered(), which drops filtered
++     * groups from the initgroups reply, only ever asks for a given domain. */
++    ret = sss_ncache_prepopulate_id_list(ncache, cdb, CONFDB_NSS_CONF_ENTRY,
++                                         option, NULL, setter);
++    if (ret != EOK) {
++        goto done;
++    }
++
++    for (dom = domain_list; dom != NULL;
++                dom = get_next_domain(dom, SSS_GND_ALL_DOMAINS)) {
++        ret = sss_ncache_prepopulate_id_list(ncache, cdb,
++                                             CONFDB_NSS_CONF_ENTRY, option,
++                                             dom, setter);
++        if (ret != EOK) {
++            goto done;
++        }
++    }
++
++    ret = EOK;
++
++done:
++    talloc_free(tmp_ctx);
++    return ret;
++}
++
+ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
+                                struct confdb_ctx *cdb,
+                                struct resp_ctx *rctx)
+@@ -1275,6 +1587,21 @@
+         }
+     }
+ 
++    /* Populate the negative cache UID and GID ranges */
++    ret = sss_ncache_prepopulate_ids(ncache, cdb, domain_list,
++                                     CONFDB_NSS_FILTER_UIDS,
++                                     sss_ncache_set_uid_range);
++    if (ret != EOK) {
++        goto done;
++    }
++
++    ret = sss_ncache_prepopulate_ids(ncache, cdb, domain_list,
++                                     CONFDB_NSS_FILTER_GIDS,
++                                     sss_ncache_set_gid_range);
++    if (ret != EOK) {
++        goto done;
++    }
++
+     /* SSSD doesn't handle "root", thus it'll be added to the negative cache
+      * nonetheless what's already added there. */
+     default_list = talloc_array(tmpctx, char *, 2);
+--- a/src/responder/common/negcache.h
++++ b/src/responder/common/negcache.h
+@@ -160,8 +160,8 @@
+ 
+ struct resp_ctx;
+ 
+-/* Set up the negative cache with values from filter_users and
+- * filter_groups in the sssd.conf
++/* Set up the negative cache with values from filter_users, filter_groups,
++ * filter_uids and filter_gids in the sssd.conf
+  */
+ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache,
+                                struct confdb_ctx *cdb,
+--- a/src/tests/cmocka/test_negcache.c
++++ b/src/tests/cmocka/test_negcache.c
+@@ -764,6 +764,201 @@
+     assert_int_equal(ret, ENOENT);
+ }
+ 
++static void test_sss_ncache_prepopulate_filter_ids(void **state)
++{
++    int ret;
++    struct test_state *ts;
++    struct tevent_context *ev;
++    struct sss_nc_ctx *ncache;
++    struct sss_test_ctx *tc;
++    const char *const testdom[4] = { TEST_SUBDOM_NAME, "TEST.SUB", "test", "S-3" };
++    struct sss_domain_info *subdomain;
++
++    struct sss_test_conf_param nss_params[] = {
++        { "filter_uids", "0-999, 65534" },
++        { "filter_gids", "60000-60010" },
++        { NULL, NULL },
++    };
++    /* Along with the valid entries, every malformed shape should be reported
++     * and skipped without making the whole prepopulation fail. */
++    struct sss_test_conf_param dom_params[] = {
++        { "filter_uids", "1234, bogus, 5000-4000, -7000, 8000-, 9000-9100x" },
++        { "filter_gids", "4321" },
++        { NULL, NULL },
++    };
++
++    ts = talloc_get_type_abort(*state, struct test_state);
++
++    ev = tevent_context_init(ts);
++    assert_non_null(ev);
++
++    ts->nctx = mock_nctx(ts);
++    assert_non_null(ts->nctx);
++
++    tc = create_dom_test_ctx(ts, TESTS_PATH, TEST_CONF_DB,
++                             TEST_DOM_NAME, TEST_ID_PROVIDER, dom_params);
++    assert_non_null(tc);
++
++    ret = add_nss_params(nss_params, tc->confdb);
++    assert_int_equal(ret, EOK);
++
++    subdomain = new_subdomain(tc, tc->dom,
++                              testdom[0], testdom[1], testdom[2], testdom[0],
++                              testdom[3], MPG_DISABLED, NULL, NULL, 0,
++                              IPA_TRUST_UNKNOWN, tc->confdb, true);
++    assert_non_null(subdomain);
++
++    ret = sysdb_subdomain_store(tc->sysdb,
++                                testdom[0], testdom[1], testdom[2], testdom[0],
++                                testdom[3], MPG_DISABLED, NULL, 0,
++                                IPA_TRUST_UNKNOWN, NULL);
++    assert_int_equal(ret, EOK);
++
++    ret = sysdb_update_subdomains(tc->dom, tc->confdb);
++    assert_int_equal(ret, EOK);
++
++    ncache = ts->ctx;
++    ts->rctx = mock_rctx(ts, ev, tc->dom, ts->nctx);
++    assert_non_null(ts->rctx);
++
++    ret = sss_names_init(ts, tc->confdb, TEST_DOM_NAME, &tc->dom->names);
++    assert_int_equal(ret, EOK);
++
++    ret = sss_ncache_prepopulate(ncache, tc->confdb, ts->rctx);
++    assert_int_equal(ret, EOK);
++
++    /* The [nss] ranges apply to every domain, boundaries included */
++    ret = check_uid_in_ncache(ncache, 0);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_uid_in_ncache(ncache, 500);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_uid_in_ncache(ncache, 999);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_uid_in_ncache(ncache, 1000);
++    assert_int_equal(ret, ENOENT);
++
++    /* A single ID is a range of one */
++    ret = check_uid_in_ncache(ncache, 65534);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_uid_in_ncache(ncache, 65535);
++    assert_int_equal(ret, ENOENT);
++
++    ret = check_gid_in_ncache(ncache, 60000);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_gid_in_ncache(ncache, 60010);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_gid_in_ncache(ncache, 60011);
++    assert_int_equal(ret, ENOENT);
++
++    /* The domain entries are scoped to that domain and its sub-domains */
++    ret = sss_ncache_check_uid(ncache, tc->dom, 1234);
++    assert_int_equal(ret, EEXIST);
++
++    ret = sss_ncache_check_uid(ncache, tc->dom->subdomains, 1234);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_uid_in_ncache(ncache, 1234);
++    assert_int_equal(ret, ENOENT);
++
++    ret = sss_ncache_check_gid(ncache, tc->dom, 4321);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_gid_in_ncache(ncache, 4321);
++    assert_int_equal(ret, ENOENT);
++
++    /* The [nss] ranges are also registered per domain, because the consumers
++     * that drop filtered groups from the initgroups reply only ever do a
++     * domain scoped check */
++    ret = sss_ncache_check_uid(ncache, tc->dom, 500);
++    assert_int_equal(ret, EEXIST);
++
++    ret = sss_ncache_check_uid(ncache, tc->dom->subdomains, 500);
++    assert_int_equal(ret, EEXIST);
++
++    ret = sss_ncache_check_gid(ncache, tc->dom, 60005);
++    assert_int_equal(ret, EEXIST);
++
++    ret = sss_ncache_check_gid(ncache, tc->dom->subdomains, 60005);
++    assert_int_equal(ret, EEXIST);
++
++    /* None of the malformed entries left anything behind */
++    const uid_t not_filtered[] = { 4000, 4500, 5000, 7000, 8000, 9000, 9100 };
++    for (size_t j = 0; j < sizeof(not_filtered) / sizeof(*not_filtered); j++) {
++        ret = sss_ncache_check_uid(ncache, tc->dom, not_filtered[j]);
++        assert_int_equal(ret, ENOENT);
++
++        ret = check_uid_in_ncache(ncache, not_filtered[j]);
++        assert_int_equal(ret, ENOENT);
++    }
++
++    /* A range holding a single ID is stored as a permanent entry, just like
++     * a name coming from filter_users, so flushing the users and the groups
++     * must leave it alone. An ordinary, non permanent ID entry is dropped. */
++    ret = sss_ncache_set_uid(ncache, false, tc->dom, 2222);
++    assert_int_equal(ret, EOK);
++
++    ret = sss_ncache_set_gid(ncache, false, tc->dom, 3333);
++    assert_int_equal(ret, EOK);
++
++    ret = sss_ncache_reset_users(ncache);
++    assert_int_equal(ret, EOK);
++
++    ret = sss_ncache_reset_groups(ncache);
++    assert_int_equal(ret, EOK);
++
++    ret = sss_ncache_check_uid(ncache, tc->dom, 2222);
++    assert_int_equal(ret, ENOENT);
++
++    ret = sss_ncache_check_gid(ncache, tc->dom, 3333);
++    assert_int_equal(ret, ENOENT);
++
++    /* the single ID filters are still there */
++    ret = sss_ncache_check_uid(ncache, tc->dom, 1234);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_uid_in_ncache(ncache, 65534);
++    assert_int_equal(ret, EEXIST);
++
++    ret = sss_ncache_check_gid(ncache, tc->dom, 4321);
++    assert_int_equal(ret, EEXIST);
++
++    /* and so are the real ranges */
++    ret = check_uid_in_ncache(ncache, 500);
++    assert_int_equal(ret, EEXIST);
++
++    ret = check_gid_in_ncache(ncache, 60005);
++    assert_int_equal(ret, EEXIST);
++
++    /* Permanent reset drops the ranges along with the single entries */
++    ret = sss_ncache_reset_permanent(ncache);
++    assert_int_equal(ret, EOK);
++
++    ret = check_uid_in_ncache(ncache, 500);
++    assert_int_equal(ret, ENOENT);
++
++    ret = check_gid_in_ncache(ncache, 60000);
++    assert_int_equal(ret, ENOENT);
++
++    ret = sss_ncache_check_uid(ncache, tc->dom, 1234);
++    assert_int_equal(ret, ENOENT);
++
++    /* ... and a repopulation brings them back */
++    ret = sss_ncache_prepopulate(ncache, tc->confdb, ts->rctx);
++    assert_int_equal(ret, EOK);
++
++    ret = check_uid_in_ncache(ncache, 500);
++    assert_int_equal(ret, EEXIST);
++
++    ret = sss_ncache_check_gid(ncache, tc->dom, 4321);
++    assert_int_equal(ret, EEXIST);
++}
++
+ static void test_sss_ncache_default_domain_suffix(void **state)
+ {
+     int ret;
+@@ -1350,6 +1545,8 @@
+                                         teardown),
+         cmocka_unit_test_setup_teardown(test_sss_ncache_prepopulate,
+                                         setup, teardown),
++        cmocka_unit_test_setup_teardown(test_sss_ncache_prepopulate_filter_ids,
++                                        setup, teardown),
+         cmocka_unit_test_setup_teardown(test_sss_ncache_default_domain_suffix,
+                                         setup, teardown),
+         cmocka_unit_test_setup_teardown(test_sss_ncache_reset_prepopulate,
+--- a/src/tests/system/tests/test_nss.py
++++ b/src/tests/system/tests/test_nss.py
+@@ -180,6 +180,112 @@
+     assert g2_ent.gid not in gids, f"{g2.name} is not filtered from {u1.name}'s groups!"
+ 
+ 
++ at pytest.mark.importance("high")
++ at pytest.mark.parametrize("section", ["nss", "domain"])
++ at pytest.mark.topology(KnownTopology.LDAP)
++def test_nss__filter_uids(client: Client, provider: LDAP, section: str):
++    """
++    :title: Test filtering of users by UID with 'filter_uids'
++    :description:
++        This test verifies that users can be filtered out of NSS lookups by
++        their numeric UID, both as a single value and as a range, using the
++        'filter_uids' option.
++    :setup:
++        1. Create users with known UIDs in provider.
++        2. Configure SSSD with 'filter_uids', using a single UID for one
++           user and a range for another.
++        3. Start SSSD.
++    :steps:
++        1. Look up the user whose UID is not filtered.
++        2. Look up the user matching the single filtered UID.
++        3. Look up the user falling inside the filtered range.
++    :expectedresults:
++        1. The non-filtered user is found.
++        2. The user matching the single UID is not found.
++        3. The user inside the range is not found.
++    :customerscenario: False
++    """
++    u1 = provider.user("user1").add(uid=10001, gid=19001)
++    u2 = provider.user("user2").add(uid=10002, gid=19002)
++    u3 = provider.user("user3").add(uid=10500, gid=19500)
++
++    if section == "nss":
++        client.sssd.nss["filter_uids"] = "10002, 10400-10600"
++    else:
++        client.sssd.domain["filter_uids"] = "10002, 10400-10600"
++    client.sssd.start(clean=True)
++
++    # UIDs outside of the filter are still resolved
++    assert client.tools.getent.passwd(10001) is not None, f"User {u1.name} should not be filtered out!"
++
++    # A single filtered UID
++    assert client.tools.getent.passwd(10002) is None, f"User {u2.name} is not filtered out by uid!"
++
++    # A UID inside a filtered range
++    assert client.tools.getent.passwd(10500) is None, f"User {u3.name} is not filtered out by uid!"
++
++
++ at pytest.mark.importance("high")
++ at pytest.mark.parametrize("section", ["nss", "domain"])
++ at pytest.mark.topology(KnownTopology.LDAP)
++def test_nss__filter_gids(client: Client, provider: LDAP, section: str):
++    """
++    :title: Test filtering of groups by GID with 'filter_gids'
++    :description:
++        This test verifies that groups can be filtered out of NSS lookups by
++        their numeric GID, both as a single value and as a range, using the
++        'filter_gids' option.
++    :setup:
++        1. Create a user and groups with known GIDs in provider.
++        2. Add the user as a member of every group.
++        3. Configure SSSD with 'filter_gids', using a single GID for one
++           group and a range for another.
++        4. Start SSSD.
++    :steps:
++        1. Look up the group whose GID is not filtered.
++        2. Look up the group matching the single filtered GID.
++        3. Look up the group falling inside the filtered range.
++        4. Check the group membership of the user.
++    :expectedresults:
++        1. The non-filtered group is found.
++        2. The group matching the single GID is not found.
++        3. The group inside the range is not found.
++        4. The filtered groups are excluded from the user's groups.
++    :customerscenario: False
++    """
++    u1 = provider.user("user1").add(uid=10001, gid=19001)
++
++    g1 = provider.group("group1").add(gid=20001)
++    g2 = provider.group("group2").add(gid=20002)
++    g3 = provider.group("group3").add(gid=20500)
++    g1.add_member(u1)
++    g2.add_member(u1)
++    g3.add_member(u1)
++
++    if section == "nss":
++        client.sssd.nss["filter_gids"] = "20002, 20400-20600"
++    else:
++        client.sssd.domain["filter_gids"] = "20002, 20400-20600"
++    client.sssd.start(clean=True)
++
++    # GIDs outside of the filter are still resolved
++    assert client.tools.getent.group(20001) is not None, f"Group {g1.name} should not be filtered out!"
++
++    # A single filtered GID
++    assert client.tools.getent.group(20002) is None, f"Group {g2.name} is not filtered out by gid!"
++
++    # A GID inside a filtered range
++    assert client.tools.getent.group(20500) is None, f"Group {g3.name} is not filtered out by gid!"
++
++    # The filtered GIDs are excluded from the user's groups
++    u1_id = client.tools.id(u1.name)
++    assert u1_id is not None, f"Command id failed for {u1.name}"
++    gids = set([group.id for group in u1_id.groups])
++    assert 20001 in gids, f"{g1.name} is missing from {u1.name}'s groups!"
++    assert 20002 not in gids, f"{g2.name} is not filtered from {u1.name}'s groups!"
++    assert 20500 not in gids, f"{g3.name} is not filtered from {u1.name}'s groups!"
++
++
+ @pytest.mark.importance("medium")
+ @pytest.mark.topology(KnownTopologyGroup.AnyProvider)
+ @pytest.mark.parametrize("config", ["enumerate", "default"])


=====================================
debian/patches/CVE-2026-104047.diff
=====================================
@@ -0,0 +1,135 @@
+From 30501ce4c57d12404d7f610122d3d76019c3dd2e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina at redhat.com>
+Date: Tue, 13 Oct 2026 14:10:03 +0200
+Subject: [PATCH] oidc_child: escape single quotes in Entra ID OData filters
+
+The Entra ID lookup path interpolated unsanitized lookup names into
+single-quoted OData $filter string literals. A local user could embed a
+single quote in an NSS lookup name to break out of the literal and inject
+arbitrary filter logic, enabling overbroad Microsoft Graph directory
+queries. Transport-layer URL encoding does not prevent this because the
+Graph server URL-decodes the filter value before parsing it as OData.
+
+Escape every embedded single quote by doubling it (OData convention)
+before building the filter, applied independently to the input and the
+derived short name at all five interpolation sites.
+
+:fixes: CVE-2026-104047
+
+Reviewed-by: Scott Poore <spoore at redhat.com>
+Reviewed-by: Sumit Bose <sbose at redhat.com>
+---
+ src/oidc_child/oidc_child_id.c | 63 +++++++++++++++++++++++++++++++---
+ 1 file changed, 58 insertions(+), 5 deletions(-)
+
+diff --git a/src/oidc_child/oidc_child_id.c b/src/oidc_child/oidc_child_id.c
+index 5d1a1074774..84d3474dd4b 100644
+--- a/src/oidc_child/oidc_child_id.c
++++ b/src/oidc_child/oidc_child_id.c
+@@ -31,6 +31,41 @@
+                               || cmd == GET_GROUP \
+                               || cmd == GET_GROUP_MEMBERS )
+ 
++static char *entra_id_escape_value(TALLOC_CTX *mem_ctx, const char *in)
++{
++    size_t quotes = 0;
++    size_t len;
++    size_t i;
++    char *out;
++    char *p;
++
++    if (in == NULL) {
++        return NULL;
++    }
++
++    len = strlen(in);
++    for (i = 0; i < len; i++) {
++        if (in[i] == '\'') {
++            quotes++;
++        }
++    }
++
++    out = talloc_array(mem_ctx, char, len + quotes + 1);
++    if (out == NULL) {
++        return NULL;
++    }
++
++    for (i = 0, p = out; i < len; i++) {
++        if (in[i] == '\'') {
++            *p++ = '\'';
++        }
++        *p++ = in[i];
++    }
++    *p = '\0';
++
++    return out;
++}
++
+ /* Extracts and normalizes the base URL from an idp_type string of
+  * the form https://... Sets *base_url to NULL if no URL is present
+  *
+@@ -96,6 +131,8 @@ errno_t entra_id_lookup(TALLOC_CTX *mem_ctx, enum oidc_cmd oidc_cmd,
+     char *uri;
+     char *filter;
+     char *filter_enc;
++    char *input_esc;
++    char *short_name_esc;
+     const char *obj_id;
+     const char **id_list;
+     char *short_name;
+@@ -115,34 +152,50 @@ errno_t entra_id_lookup(TALLOC_CTX *mem_ctx, enum oidc_cmd oidc_cmd,
+         }
+     }
+ 
++    input_esc = entra_id_escape_value(rest_ctx, input);
++    if (input_esc == NULL) {
++        DEBUG(SSSDBG_OP_FAILURE, "Failed to escape input.\n");
++        ret = ENOMEM;
++        goto done;
++    }
++
+     switch (oidc_cmd) {
+     case GET_USER:
+     case GET_USER_GROUPS:
+         sep = strrchr(input, '@');
+         if (sep == NULL || sep == input) {
+-            filter = talloc_asprintf(rest_ctx, "startsWith(userPrincipalName,'%s@')", input);
++            filter = talloc_asprintf(rest_ctx,
++                                     "startsWith(userPrincipalName,'%s@')",
++                                     input_esc);
+         } else {
+             filter = talloc_asprintf(rest_ctx,
+                                      "mail eq '%s' or userPrincipalName eq '%s'",
+-                                     input, input);
++                                     input_esc, input_esc);
+         }
+         break;
+     case GET_GROUP:
+     case GET_GROUP_MEMBERS:
+         sep = strrchr(input, '@');
+         if (sep == NULL || sep == input) {
+-            filter = talloc_asprintf(rest_ctx, "displayName eq '%s'", input);
++            filter = talloc_asprintf(rest_ctx, "displayName eq '%s'", input_esc);
+         } else {
+             short_name = talloc_strndup(rest_ctx, input, sep - input);
+             if (short_name == NULL) {
+                 DEBUG(SSSDBG_OP_FAILURE,
+                       "Failed to generate short name, using plain input [%s].\n",
+                       input);
+-                filter = talloc_asprintf(rest_ctx, "displayName eq '%s'", input);
++                filter = talloc_asprintf(rest_ctx, "displayName eq '%s'", input_esc);
+             } else {
++                short_name_esc = entra_id_escape_value(rest_ctx, short_name);
++                if (short_name_esc == NULL) {
++                    DEBUG(SSSDBG_OP_FAILURE,
++                          "Failed to escape short name [%s].\n", short_name);
++                    ret = ENOMEM;
++                    goto done;
++                }
+                 filter = talloc_asprintf(rest_ctx,
+                                          "displayName eq '%s' or displayName eq '%s'",
+-                                         input, short_name);
++                                         input_esc, short_name_esc);
+             }
+         }
+         break;


=====================================
debian/patches/CVE-2026-104048.diff
=====================================
@@ -0,0 +1,78 @@
+From b7234202fea1b1092ac20aed68abedc413883cca Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina at redhat.com>
+Date: Tue, 13 Oct 2026 14:08:48 +0200
+Subject: [PATCH] ipa: compare users with domain awareness against HBAC rules
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+HBAC reduced both the request-side and rule-side user identities to bare
+shortnames before comparison, discarding the domain. In trust-enabled IPA
+deployments this let a trusted-domain user whose shortname collided with an
+IPA-local user named in an HBAC allow rule satisfy that rule, bypassing the
+intended authorization boundary.
+
+Preserve the fully-qualified internal name (user at domain) on both SSSD call
+sites instead of stripping it to the shortname:
+
+- hbac_eval_user_element() (ipa_hbac_common.c): store the already
+  domain-qualified username directly in users->name.
+- hbac_user_attrs_to_rule() (ipa_hbac_users.c): store the already
+  internal-fqname-formatted SYSDB_NAME directly in new_users->names[].
+
+:fixes: CVE-2026-104048
+
+Assisted-By: Claude Code (Opus 4.8)
+Reviewed-by: Alexey Tikhonov <atikhono at redhat.com>
+Reviewed-by: Tomáš Halman <thalman at redhat.com>
+---
+ src/providers/ipa/ipa_hbac_common.c |  9 +++++----
+ src/providers/ipa/ipa_hbac_users.c  | 12 +++---------
+ 2 files changed, 8 insertions(+), 13 deletions(-)
+
+diff --git a/src/providers/ipa/ipa_hbac_common.c b/src/providers/ipa/ipa_hbac_common.c
+index 1fee41a36df..7d6ea8dd075 100644
+--- a/src/providers/ipa/ipa_hbac_common.c
++++ b/src/providers/ipa/ipa_hbac_common.c
+@@ -393,12 +393,13 @@ hbac_eval_user_element(TALLOC_CTX *mem_ctx,
+         goto done;
+     }
+ 
+-    ret = sss_parse_internal_fqname(tmp_ctx, username, &shortname, NULL);
+-    if (ret != EOK) {
+-        ret = ERR_WRONG_NAME_FORMAT;
++    /* Keep the fully-qualified internal name (user at domain) so that the HBAC
++     * evaluator compares users with domain awareness. */
++    users->name = talloc_strdup(users, username);
++    if (users->name == NULL) {
++        ret = ENOMEM;
+         goto done;
+     }
+-    users->name = talloc_steal(users, shortname);
+ 
+     ipa_domain = get_domains_head(domain);
+     if (ipa_domain == NULL) {
+diff --git a/src/providers/ipa/ipa_hbac_users.c b/src/providers/ipa/ipa_hbac_users.c
+index 2f9e9865de7..b2092cefbc9 100644
+--- a/src/providers/ipa/ipa_hbac_users.c
++++ b/src/providers/ipa/ipa_hbac_users.c
+@@ -257,16 +257,10 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx,
+                 goto done;
+             }
+ 
+-            ret = sss_parse_internal_fqname(tmp_ctx, sysdb_name,
+-                                            &shortname, NULL);
+-            if (ret != EOK) {
+-                DEBUG(SSSDBG_CRIT_FAILURE,
+-                      "Cannot parse %s, skipping\n", sysdb_name);
+-                continue;
+-            }
+-
++            /* Store the fully-qualified internal name (user at domain) so that the
++             * HBAC evaluator compares rule users with domain awareness. */
+             new_users->names[num_users] = talloc_strdup(new_users->names,
+-                                                        shortname);
++                                                        sysdb_name);
+             if (new_users->names[num_users] == NULL) {
+                 ret = ENOMEM;
+                 goto done;


=====================================
debian/patches/CVE-2026-92821.diff
=====================================
@@ -0,0 +1,57 @@
+From e83a29ceaffb1cb106696f24213a1ed6851f6baf Mon Sep 17 00:00:00 2001
+From: Sumit Bose <sbose at redhat.com>
+Date: Fri, 25 Sep 2026 13:49:10 +0200
+Subject: [PATCH] ldap: pwd_expire_policy_warn does not overwrite errors
+
+Make sure the 'pwd_expire_policy_warn' access check does not overwrite
+any access denied or other errors.
+
+:fixes: CVE-2026-92821
+
+Reviewed-by: Alexey Tikhonov <atikhono at redhat.com>
+Reviewed-by: Dan Lavu <dlavu at redhat.com>
+---
+ src/providers/ldap/sdap_access.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c
+index cfdde8c014c..cc3c2baa755 100644
+--- a/src/providers/ldap/sdap_access.c
++++ b/src/providers/ldap/sdap_access.c
+@@ -116,6 +116,7 @@ struct sdap_access_req_ctx {
+     struct ldb_message *user_entry;
+     size_t current_rule;
+     enum sdap_access_control_type ac_type;
++    bool pw_expire_warn_seen;
+ };
+ 
+ static errno_t sdap_access_check_next_rule(struct sdap_access_req_ctx *state,
+@@ -150,6 +151,7 @@ sdap_access_send(TALLOC_CTX *mem_ctx,
+     state->access_ctx = access_ctx;
+     state->conn = conn;
+     state->current_rule = 0;
++    state->pw_expire_warn_seen = false;
+ 
+     DEBUG(SSSDBG_TRACE_FUNC,
+           "Performing access check for user [%s]\n", pd->user);
+@@ -212,8 +214,8 @@ static errno_t sdap_access_check_next_rule(struct sdap_access_req_ctx *state,
+     while (ret == EOK) {
+         switch (state->access_ctx->access_rule[state->current_rule]) {
+         case LDAP_ACCESS_EMPTY:
+-            /* we are done with no errors */
+-            return EOK;
++            /* all rules passed; preserve warn semantics if seen */
++            return state->pw_expire_warn_seen ? ERR_PASSWORD_EXPIRED_WARN : EOK;
+ 
+         /* This option is deprecated by LDAP_ACCESS_PPOLICY */
+         case LDAP_ACCESS_LOCKOUT:
+@@ -295,7 +297,8 @@ static errno_t sdap_access_check_next_rule(struct sdap_access_req_ctx *state,
+                                           state->access_ctx->type,
+                                           state->access_ctx->id_ctx->opts);
+             if (ret == ERR_PASSWORD_EXPIRED) {
+-                ret = ERR_PASSWORD_EXPIRED_WARN;
++                state->pw_expire_warn_seen = true;
++                ret = EOK;
+             }
+             break;
+ 


=====================================
debian/patches/series
=====================================
@@ -34,3 +34,9 @@ CVE-2026-104044-pre.diff
 CVE-2026-104044.diff
 CVE-2026-104045.diff
 CVE-2026-104046.diff
+CVE-2026-104047.diff
+CVE-2026-104048.diff
+CVE-2026-104041_pre_NSS-Add-options-to-exclude-UID-and-GID.diff
+CVE-2026-104041-1.diff
+CVE-2026-104041-2.diff
+CVE-2026-92821.diff



View it on GitLab: https://salsa.debian.org/sssd-team/sssd/-/compare/4044244d710a494e575e67c186db90055d9ed3f2...fea666d99f9b0f2d7d75f7f05a85f61f6a76123f

-- 
View it on GitLab: https://salsa.debian.org/sssd-team/sssd/-/compare/4044244d710a494e575e67c186db90055d9ed3f2...fea666d99f9b0f2d7d75f7f05a85f61f6a76123f
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-sssd-devel/attachments/20261113/88f59425/attachment-0001.htm>


More information about the Pkg-sssd-devel mailing list