Repository navigation
fix(security): close cookie, workflow and image-lint code scanning findings - #54
Merged
Merged
Conversation
Mark the JupyterHub logout cookies Secure on HTTPS, and allow COOKIE_SECURE=false so a plain-HTTP portal can still clear them. Limit the mirror and image-publish workflows to contents: read. Pin the base image digests and Alpine packages, run as uid 10001, and use a JSON healthcheck.
The Corretto base image ships zlib 1.3.2-r1, which OSV scores as CVE-2026-4738 and which fails the container CVSS gate. 1.4-r0 is the fixed Alpine 3.24 package.
KFilippopolitis
force-pushed
the
cursor/fix-code-scanning-alerts-7864
branch
from
November 9, 2026 18:01
240f75a to
d9f7de6
Compare
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.
Summary
Closes the code-scanning findings that have a safe fix in this tree. Spring, Jackson, pgjdbc and dockerize alerts are left open on purpose: the runtime dependencies are already on the newest patched stable releases, and dockerize is no longer installed.
The first CI run of this branch failed the container CVSS gate on Alpine zlib (CVE-2026-4738). The base image ships 1.3.2-r1; this PR now installs Alpine 3.24
zlib=1.4-r0, which OSV reports as fixed.GitHub code scanning list API returned 403 for this token, so alert numbers come from the 2026-11-09 triage. That triage names 41 of the 43 open alerts. The other two numbers are not in the triage and were not readable here.
Fixed
.github/workflows/publish_images.ymlhad nopermissionsblock. Workflow token is nowcontents: read(checkout and Docker build; images go to Docker Hub and Harbor, not GHCR). Same shape aspublish_staging_images.yml..github/workflows/ebrains.ymlhad nopermissionsblock. Workflow token is nowcontents: read. The GitLab mirror uses the EBRAINS token in the destination URL, not a GitHub contents write.cookie-issecure-falseatSecurityConfiguration.java(JupyterHub logout cookies).setSecureis set whenauthentication.secure_cookiesis true (default) and the request is HTTPS, includingX-Forwarded-Proto.COOKIE_SECURE=falsekeeps clearing those cookies over plain HTTP. PortalJSESSIONIDis unchanged, so local HTTP sign-in still works. OpenGrepcookie-issecure-falseis clean. Logout tests cover HTTPS (Secure) and HTTP (not Secure).dockerfile-source-not-pinnedon bothFROMlines,prefer-json-notationon the shell-formHEALTHCHECK). Base images are pinned to the multi-arch index digests, and the healthcheck is JSONsh -cwithpipefail. OpenGrep onsemgrep-rules/dockerfile@17e31e11reports 0 findings.apk add, DL3066 non-numericUSER, DL3025 shell-form healthcheck). Alpine 3.24 packages are pinned (libcrypto3/libssl33.5.9-r0,curl8.23.0-r0,zlib1.4-r0). 3.5.9-r0 is newer than 3.5.8-r0, which fixed CVE-2026-14456, CVE-2026-63073 and CVE-2026-75803. The process runs as uid 10001. Hadolint 2.15.1 exits 0.adduser -D -H -u 10001was checked in an Alpine 3.24 rootfs.Remaining
No dependency version in
pom.xmlwas changed.mvn dependency:treeplus the OSV API on all 121 compile/runtime coordinates returned zero vulnerabilities. Spring Boot 4.2.0 and Spring Framework 7.1.0 are release candidates only (4.2.0-RC2 / 7.1.0-RC2, 2026-11-05). Jumping to an RC to chase an already-patched advisory is not safe.platform-backend.jar. Same dependency set as above: OSV has no current advisory for any coordinate the jar resolves. The 2026-11-09 SCA run on master uploaded a clean gate (max CVSS under 5). Nothing further to override. These alerts were not dismissed.os.Root), 145 (medium,crypto/tls), 143, 159, 160, 161 (warning, other Go stdlib CVEs) — dockerize. Removed in9ad0d992(the image runsjava -jardirectly). Reinstalling jwilder/dockerize or powerman/dockerize would put a Go binary back into an image that does not use it. No patch in this PR can delete a file that is already gone. These alerts were not dismissed.Tests
mvn -B -ntp test— 167 tests, 0 failuresmvn -B -ntp package— BUILD SUCCESS, 167 tests, 0 failuresDockerfile— exit 0semgrep-rules/dockerfile@17e31e11— 0 findingscookie-issecure-false— 0 findingszlib 1.3.2-r1(CVE-2026-4738);1.4-r0is cleanpre-commitis not installed in this environment, so it was not run.Risk
COOKIE_SECURE=false(needed only when the portal itself is plain HTTP and those hub cookies must still be cleared).forward-headers-strategy: nativeis already set, so a TLS-terminating proxy that sendsX-Forwarded-Proto: httpsstill gets Secure cookies.--upgrade.GITHUB_TOKENpackage write.Rollback
Revert these commits. No schema, API route, or Maven dependency change.