Repository navigation
fix(security): let the demo pages sign in at /rest/saiku/session/ again (#2439) - #2444
Merged
juanresendiz813 merged 3 commits intoNov 19, 2026
Conversation
…ata#2439) POST /rest/saiku/session/ (form-encoded) is the login embed-demo, aqvira-demo and both showcase pages make. spiculedata#2368 left it refused (CSRF 403, then no permitAll). The spec is a command spec because the login consumes form data and api specs send JSON only. It also pins that nothing beneath /rest/saiku/session/ is reopened. Signed-off-by: Juan Resendiz <50384386+juanresendiz813@users.noreply.github.com>
…in (spiculedata#2439) spiculedata#2368 dropped the /rest/saiku/session/** permitAll rule and narrowed the CSRF login exemption to ^/rest/saiku/session$. The public demo pages (embed-demo, aqvira-demo, both showcases) log in with POST /rest/saiku/session/ (trailing slash), which Ant matching and the regex both treat as a different path, so the login got a CSRF 403 and every later call a 401. Open exactly that spelling and nothing more: - SaikuCsrfRequestMatcher LOGIN_PATH is now ^/rest/saiku/session/?$ - an exact <intercept-url pattern="/rest/saiku/session/" access="permitAll"/> beside the no-slash rule, with no /** wildcard Everything beneath /rest/saiku/session/ (including the removed /clear) stays CSRF-checked and authenticated. Pinned by SaikuCsrfRequestMatcherTest, SpringUrlRulesGuestExclusionTest (real XML rules) and CsrfIT (posts to the exact URL the pages use, then uses the cookie). Signed-off-by: Juan Resendiz <50384386+juanresendiz813@users.noreply.github.com>
…is given CI runs command specs without ACCEPTANCE_BASE_URL, so the spec failed on the PR build. Without a base URL it now checks the tree it runs in: LOGIN_PATH exempts /rest/saiku/session and /rest/saiku/session/ and nothing beneath them, applicationContext-saiku.xml has the exact /rest/saiku/session/ permitAll rule and no wildcard session rule, and the matcher, URL-rule and launcher IT tests pin the trailing-slash login. With a base URL it also runs the live login and sub-path checks. Signed-off-by: Juan Resendiz <50384386+juanresendiz813@users.noreply.github.com>
Merged
via the queue into
spiculedata:development
with commit Nov 19, 2026
213bca5
27 of 28 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2439
What
#2368 removed
/session/clear. To do that it dropped the/rest/saiku/session/**permitAll rule and narrowed the CSRF login exemption to^/rest/saiku/session$. The public demo pages sign in withPOST /rest/saiku/session/(trailing slash):embed-demo,aqvira-demo,saiku-ui/static/showcaseandsaiku-showcase.DemoPagesHardeningTestpins that URL. Ant matching and the regex both treat the trailing-slash path as a different path, so that login now gets a CSRF 403, and every call after it gets a 401. demo.saiku.bi runsdevelopment-green, so its demo pages can't sign in.This PR takes the server-side option from the issue. It opens exactly that spelling and nothing more:
SaikuCsrfRequestMatcher.LOGIN_PATH:^/rest/saiku/session$→^/rest/saiku/session/?$applicationContext-saiku.xml: one new rule,<security:intercept-url pattern="/rest/saiku/session/" access="permitAll" />, beside the existing no-slash rule and configured the same way. It is an exact path with no/**.Everything beneath
/rest/saiku/session/stays CSRF-checked and authenticated, including the removed/clear. Nothing that #2368 closed is reopened. The no-slash login and logout rules are unchanged./rest/saiku/session/now has the same semantics as/rest/saiku/session: permitAll, and CSRF-exempt for every method. That includesDELETE(logout), which is what the no-slash path already allows.Tests
acceptance/2439/spec.json+check.mjs: this is a command spec, because the login consumes form data and api specs send only JSON. C1: an anonymous formPOST /rest/saiku/session/returns 200 and setsJSESSIONID, andGET /rest/saiku/sessionwith only that cookie reports the user. C2: anonymousPOST /rest/saiku/session/clearandPOST /rest/saiku/session/anythingare refused (403/404/405), and anonymousGET /rest/saiku/session/anythingreturns 401/403. Committed first. Run locally against a launcher on 127.0.0.1:POST /rest/saiku/session/answered 403SaikuCsrfRequestMatcherTest:/rest/saiku/session/is exempt./session/clear,/session/clear/,/session/anything,/sessionxand/session/;x/clearare not.SpringUrlRulesGuestExclusionTestevaluates the real XML rules. Anonymous is granted/rest/saiku/session/and denied/session/clear,/session/anythingand/session/clear/.CsrfIT(launcher) posts to the exact URL the pages use and then uses the cookie. An anonymous POST beneath/session/gets 403.Ran:
mvn -B -ntp -pl saiku-core/saiku-web -am verify(green; saiku-service 2880 tests, saiku-web 1492).mvn -pl saiku-launcher -am -DskipITs=false verify -Dtest=DemoPagesHardeningTest -Dit.test=CsrfIT,SessionIT(green: 3 + 7 + 4).node --test ".github/scripts/*.test.mjs"(407 pass).🤖 Generated with Claude Code