{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "packageName": "org.apache.karaf.jaas.modules.ldap",
          "product": "Apache Karaf",
          "vendor": "Apache Software Foundation",
          "versions": [
            {
              "lessThan": "4.4.12",
              "status": "affected",
              "version": "0",
              "versionType": "semver"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "reporter",
          "value": "Gjoko Krstic <gjoko@zeroscience.mk>"
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "supportingMedia": [
            {
              "base64": false,
              "type": "text/html",
              "value": "<p><span>LDAPCache</span>&nbsp;and&nbsp;<code>LDAPBackingEngine</code>&nbsp;build LDAP search filters for user lookup and role lookup by textually substituting the placeholders&nbsp;<code>%u</code>,&nbsp;<code>%dn</code>, and&nbsp;<code>%fqdn</code>&nbsp;(drawn from the login name, the resolved user DN, and its fully qualified namespace form) into administrator-configured filter templates (<code>userFilter</code>,&nbsp;<code>roleFilter</code>). Before the fix, the only sanitization applied to the substituted value was double backslashed:</p><div><code>filter = filter.replaceAll(Pattern.quote(\"%u\"), Matcher.quoteReplacement(user));</code></div><div><code>filter = filter.replace(\"\\\\\", \"\\\\\\\\\");</code></div><div><br></div><div>This does not escape the other characters RFC 4515 requires escaping in an LDAP search filter:&nbsp;<code>*</code>,&nbsp;<code>(</code>,&nbsp;<code>)</code>, and&nbsp;<code>NUL</code>. A login name containing any of these can change the structure of the resulting filter rather than being matched as a literal value (e.g. a crafted username can turn an equality match into a wildcard match, or close/reopen filter clauses), widening what the search returns and potentially causing a login or role lookup to match an LDAP entry other than the intended one, over-granting roles, and depending on deployment-specific filter templates, potentially affecting which account a login resolved to.</div><div><br></div><div>It's not exploitable through every entry points:&nbsp;<code>LDAPLoginModule</code>&nbsp;and&nbsp;<code>LDAPPubkeyLoginModule</code>&nbsp;both called&nbsp;<code>Util.doRFC2254Encoding()</code>&nbsp;(correct RFC 4515 escaping) on the login name before handing it to&nbsp;<code>LDAPCache</code>, which masked the missing escaping in&nbsp;<code>LDAPCache</code>&nbsp;for those two call paths. Using&nbsp;<code>LDAPCache</code>&nbsp;directly (bypassing the login modules) does not reproduce through the normal&nbsp;<code>LDAPLoginModule</code>/<code>LDAPPubkeyLoginModule</code>&nbsp;authentication flow for this reason. It does reproduce through two other call paths that reach&nbsp;<code>LDAPCache</code>/<code>LDAPBackingEngine</code>&nbsp;without any prior escaping:</div><div><ul><li><code>GSSAPILdapLoginModule</code>&nbsp;passes the&nbsp;<code>NameCallback</code>&nbsp;name straight through, unescaped.</li><li><code>LDAPBackingEngine</code>&nbsp;(<code>listRoles</code>) passes&nbsp;<code>principal.getName()</code>&nbsp;straight through, unescaped.</li></ul><div><br></div></div>"
            }
          ],
          "value": "LDAPCache\u00a0and\u00a0LDAPBackingEngine\u00a0build LDAP search filters for user lookup and role lookup by textually substituting the placeholders\u00a0%u,\u00a0%dn, and\u00a0%fqdn\u00a0(drawn from the login name, the resolved user DN, and its fully qualified namespace form) into administrator-configured filter templates (userFilter,\u00a0roleFilter). Before the fix, the only sanitization applied to the substituted value was double backslashed:\n\nfilter = filter.replaceAll(Pattern.quote(\"%u\"), Matcher.quoteReplacement(user));\n\nfilter = filter.replace(\"\\\\\", \"\\\\\\\\\");\n\n\n\n\nThis does not escape the other characters RFC 4515 requires escaping in an LDAP search filter:\u00a0*,\u00a0(,\u00a0), and\u00a0NUL. A login name containing any of these can change the structure of the resulting filter rather than being matched as a literal value (e.g. a crafted username can turn an equality match into a wildcard match, or close/reopen filter clauses), widening what the search returns and potentially causing a login or role lookup to match an LDAP entry other than the intended one, over-granting roles, and depending on deployment-specific filter templates, potentially affecting which account a login resolved to.\n\n\n\n\nIt's not exploitable through every entry points:\u00a0LDAPLoginModule\u00a0and\u00a0LDAPPubkeyLoginModule\u00a0both called\u00a0Util.doRFC2254Encoding()\u00a0(correct RFC 4515 escaping) on the login name before handing it to\u00a0LDAPCache, which masked the missing escaping in\u00a0LDAPCache\u00a0for those two call paths. Using\u00a0LDAPCache\u00a0directly (bypassing the login modules) does not reproduce through the normal\u00a0LDAPLoginModule/LDAPPubkeyLoginModule\u00a0authentication flow for this reason. It does reproduce through two other call paths that reach\u00a0LDAPCache/LDAPBackingEngine\u00a0without any prior escaping:\n\n  *  GSSAPILdapLoginModule\u00a0passes the\u00a0NameCallback\u00a0name straight through, unescaped.\n  *  LDAPBackingEngine\u00a0(listRoles) passes\u00a0principal.getName()\u00a0straight through, unescaped."
        }
      ],
      "metrics": [
        {
          "other": {
            "content": {
              "text": "moderate"
            },
            "type": "Textual description of severity"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-90",
              "description": "CWE-90 Improper neutralization of special elements used in an LDAP query ('LDAP injection')",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "orgId": "f0158376-9dc2-43b6-827c-5f631a4d8d09"
      },
      "references": [
        {
          "tags": [
            "vendor-advisory"
          ],
          "url": "https://karaf.apache.org/security/cve-2026-90979.txt"
        }
      ],
      "source": {
        "advisory": "https://karaf.apache.org/security/cve-2026-90979.txt",
        "defect": [
          "https://github.com/apache/karaf/pull/2880"
        ],
        "discovery": "EXTERNAL"
      },
      "title": "LDAP filter injection in JAAS LDAP login modules",
      "x_generator": {
        "engine": "Vulnogram 1.0.3"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "f0158376-9dc2-43b6-827c-5f631a4d8d09",
    "cveId": "CVE-2026-90979",
    "serial": 1,
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.0"
}