Skip to content

feat(sso): report insecure SAML settings - #3224

Merged
marevol merged 1 commit into
masterfrom
saml-security-warnings
Aug 10, 2026
Merged

feat(sso): report insecure SAML settings#3224
marevol merged 1 commit into
masterfrom
saml-security-warnings

Conversation

@marevol

@marevol marevol commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Stacked on #3219 (→ #3217#3214) — this PR targets saml-slo-response. Merge #3214, #3217, #3219, then this one.

getSecurityWarnings() had no caller

java-saml exposes Saml2Settings#getSecurityWarnings() for configuration that is weak but not fatal — the things checkSettings() deliberately does not reject. Nothing in Fess called it, so an installation running on the permissive defaults had no way to learn about it short of reading Saml2Settings.

getSettings() now logs them. With the shipped defaults that is:

Insecure SAML settings: deprecated_signature_algorithms_not_rejected,
assertions_and_messages_not_required_signed. See the SAML SSO documentation
for the recommended values.

Settings are rebuilt on every request (see #3217), so logging unconditionally would put this line in front of every login. The warnings are compared with the previous set and logged only when they change, which also means editing the configuration in the admin UI re-reports the new state rather than going quiet forever after the first request.

To be explicit about what this is and is not: want_assertions_signed=false does not allow unsigned assertions. SamlResponse#isValid rejects a response with no signed element unconditionally, outside the strict block. The flag only relaxes which element must carry the signature, so this is a hardening prompt, not a vulnerability notice. The defaults are left as they are.

Dropped: the SameSite note

This PR originally also documented in src/main/assemblies/files/tomcat_config.properties why the SAML HTTP-POST binding cannot run on the default tomcat.sameSiteCookies = lax. #3215 has since landed equivalent guidance on master, and its wording is broader — it covers Entra ID response_mode=form_post as well as SAML, and names session.cookie.secure=true. The note was dropped on rebase rather than replacing the merged one; the default is still unchanged, since none requires HTTPS.

Test

test_getSettings_logsSecurityWarningsUntilTheyChange captures the logger with the LogCapturingAppender pattern already used in LengthChunkerTest, asserts the defaults produce exactly one warning across two getSettings() calls, then flips saml.security.want_assertions_signed and asserts the changed set is reported again. Confirmed falsifiable: logging unconditionally makes the first assertion fail with expected: <1> but was: <2>.

Tests run: 143, Failures: 0, Errors: 0, Skipped: 0   (org.codelibs.fess.sso.**)

@marevol
marevol force-pushed the saml-security-warnings branch from de2260c to 67d885e Compare August 10, 2026 00:51
@marevol
marevol force-pushed the saml-security-warnings branch from 67d885e to 2aed508 Compare August 10, 2026 01:40
@marevol marevol changed the title feat(sso): report insecure SAML settings and the SameSite requirement feat(sso): report insecure SAML settings Aug 10, 2026
@marevol
marevol force-pushed the saml-security-warnings branch from 2aed508 to e6ea423 Compare August 10, 2026 01:57
@marevol
marevol force-pushed the saml-security-warnings branch from e6ea423 to edcf005 Compare August 10, 2026 02:12
Base automatically changed from saml-slo-response to master August 10, 2026 02:21
java-saml exposes Saml2Settings#getSecurityWarnings(), which flags weak but
non-fatal configuration. Nothing called it, so a deployment running on the
permissive defaults had no way to learn about it except by reading the code.
getSettings() now logs the warnings at WARN. Since the settings are rebuilt
on every request, the warnings are repeated only when they change, so editing
the configuration from the admin UI re-reports the new state without flooding
the log in between.

With the shipped defaults the message is:

  Insecure SAML settings: deprecated_signature_algorithms_not_rejected,
  assertions_and_messages_not_required_signed. See the SAML SSO documentation
  for the recommended values.

The tomcat_config.properties note this change originally carried about
SameSite and the SAML HTTP-POST binding is dropped: #3215 landed the same
guidance on master, covering both SAML and Entra ID form_post.
@marevol
marevol force-pushed the saml-security-warnings branch from edcf005 to 38d3507 Compare August 10, 2026 02:21
@marevol marevol self-assigned this Aug 10, 2026
@marevol marevol added this to the 15.8.0 milestone Aug 10, 2026
@marevol
marevol merged commit 22cb785 into master Aug 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant