Repository navigation
Harden sessions, headers and scans; run shared jobs once across instances - #103
Merged
Merged
Conversation
…request A request that carried any Authorization header skipped the CSRF check, even when the header authenticated nothing. Next to a signed-in browser's session cookie, a junk header (Basic, an unknown bearer token, anything) let a state-changing request through without a CSRF token. An Authorization header that is not a valid API bearer token is now refused with 401, and only a request a bearer token authenticated skips CSRF. API clients that send a valid token see no change; a client that sent a stale or malformed header alongside a session must drop it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Disabling a user, removing a grant from them, or changing a role's permissions now signs out every affected user at once. Their next request answers 401. Before, a session kept the grants it had at sign-in until it timed out, up to 8 hours. Sessions are also stored in the database again. Spring Boot 4 moved session auto-configuration into its own module, which was missing, so sessions were held in memory: lost on restart and not shared between instances. Studio now uses spring-boot-starter-session-jdbc and the existing spring_session tables. The session cookie is now named SESSION instead of JSESSIONID, so everyone signs in again once after upgrading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…assets Every response now carries a Content-Security-Policy. Scripts, connections and workers must come from Studio's own origin, plugins (object/embed) are refused, and no page may frame Studio. If an injection bug ever let markup through, it could neither load a script from elsewhere nor send data out. Every SVG a plugin serves is now sandboxed, as its icon already was, so an SVG opened directly renders inert instead of running as Studio. Plugin UIs are unaffected when they bundle what they load, as the plugin guide asks. A UI that pulled scripts, fonts or data from another origin must bundle them instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Spring Boot 4.1 still manages Tomcat 11.0.24, which carries three critical vulnerabilities (GHSA-9xv2-5v5q-p794, GHSA-gcx9-497g-6cp6, GHSA-h3x4-894j-xpx5). Studio now runs 11.0.25. The plugin template compiles against the same version. Development tooling is patched too: adm-zip, used by the module federation build, is raised to 0.6.1, and the documentation site builds on Vite 6.4.3. Neither ships in the image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds both workflows and ADR-0124. OSV-Scanner fails a pull request that adds a known vulnerability and fails main and the weekly run on any. CodeQL (security-extended) reports to code scanning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When several Studio instances share one database, every instance used to run every background job, so housekeeping, reapers, sweeps and partition maintenance ran once per instance. Jobs whose work is on shared state now run on one instance per tick, through ShedLock on Studio's database (a new shedlock table): preview housekeeping, the event, request-reply and metric reapers, the request-reply deadline sweep, partition maintenance, scrape tier C and topology discovery. A crashed instance frees its jobs within a minute or one interval. The job status API reports each job's scope and when another instance last ran it; a tick another instance ran never makes a job look stalled. BREAKING CHANGE: the plugin contract is now 4. Every ScheduledJob states a scope: ScheduledJob.fixedDelay(id, featureId, Scope.INSTALLATION or Scope.INSTANCE, interval, task), and the same for cron. Use INSTALLATION for work on shared rows and INSTANCE for this instance's own state (a cache, a buffer). Rebuild plugins against this release with studio.contract 4; Studio refuses plugins built for contract 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
GitHub refuses results from an advanced CodeQL workflow while the repository's default setup is enabled, and default setup already analyses Java, TypeScript, Actions and Python on every pull request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Implements the
harden-sessions-headers-jobsOpenSpec change.Security
Authorizationheader is answered with 401. Before, a junk header plus the session cookie skipped the check.spring-boot-starter-session-jdbcmodule was missing, so they were held in memory. Disabling a user, removing a grant or changing a role's permissions ends the affected users' sessions (ADR-0123).script-src 'self' 'wasm-unsafe-eval',frame-ancestors 'none', …), and every plugin SVG is sandboxed (ADR-0122). The plugin-template e2e now fails on any CSP refusal.Jobs (breaking for plugins)
ScheduledJobdeclaresScope.INSTANCEorScope.INSTALLATION. Installation-wide jobs run on one instance per tick through ShedLock (ADR-0125). Plugin contract 4.Verification
./mvnw verifygreen locally (1328 tests); web build and lint green. One web test was flaky under load; it passes on its own, 3 of 3.🤖 Generated with Claude Code