Skip to content

fix(security): let the demo pages sign in at /rest/saiku/session/ again (#2439) - #2444

Merged
juanresendiz813 merged 3 commits into
spiculedata:developmentfrom
juanresendiz813:fix/2439-session-trailing-slash-login
Nov 19, 2026
Merged

juanresendiz813 merged 3 commits into
spiculedata:developmentfrom
juanresendiz813:fix/2439-session-trailing-slash-login

Conversation

@juanresendiz813

Copy link
Copy Markdown
Contributor

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 with POST /rest/saiku/session/ (trailing slash): embed-demo, aqvira-demo, saiku-ui/static/showcase and saiku-showcase. DemoPagesHardeningTest pins 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 runs development-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 includes DELETE (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 form POST /rest/saiku/session/ returns 200 and sets JSESSIONID, and GET /rest/saiku/session with only that cookie reports the user. C2: anonymous POST /rest/saiku/session/clear and POST /rest/saiku/session/anything are refused (403/404/405), and anonymous GET /rest/saiku/session/anything returns 401/403. Committed first. Run locally against a launcher on 127.0.0.1:
    • base (ee7befc): fail, C1: POST /rest/saiku/session/ answered 403
    • head: pass
  • SaikuCsrfRequestMatcherTest: /rest/saiku/session/ is exempt. /session/clear, /session/clear/, /session/anything, /sessionx and /session/;x/clear are not.
  • SpringUrlRulesGuestExclusionTest evaluates the real XML rules. Anonymous is granted /rest/saiku/session/ and denied /session/clear, /session/anything and /session/clear/.
  • CsrfIT (launcher) posts to the exact URL the pages use and then uses the cookie. An anonymous POST beneath /session/ gets 403.
  • Both new unit tests fail against the base matcher and XML, and pass on head.

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

…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>
@github-actions github-actions Bot added risk/high Change risk tier: high (see docs/risk-tiers.md) area/web area/launcher labels Nov 19, 2026
…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>
@juanresendiz813
juanresendiz813 added this pull request to the merge queue Nov 19, 2026
Merged via the queue into spiculedata:development with commit 213bca5 Nov 19, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/launcher area/web risk/high Change risk tier: high (see docs/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Demo pages and showcase can't sign in: POST /rest/saiku/session/ (trailing slash) lost its CSRF exemption and permitAll

1 participant