Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… validate ARTEMIS_URL Addresses four findings from the security audit of the env-var-passthrough work: - Gradle prewarm no longer auto-executes the cloned repo's ./gradlew wrapper. The student must explicitly confirm before any repository-controlled Gradle build runs, and confirmation defaults to "no". This removes a silent remote-code-execution path from tampered exercise templates while keeping prewarm available as an opt-in. - The VCS/Git token is no longer embedded in the clone URL or passed on the git command line. It is injected into the git process via GIT_CONFIG_* environment variables during clone and persisted only into .git/config for later in-IDE fetch/push. The unused addVcsTokenToUrl helper is removed. Residual: the short-lived token is still written to .git/config so push/fetch keep working. - STOMP/WebSocket frame logging is disabled so the Artemis JWT in the CONNECT frame is never written to the debug console. - The ARTEMIS_URL environment override is validated against the configured Artemis origin (scheme + host + port) before being used as the API base, preventing the Bearer token from being sent to an untrusted host. Adds unit tests for the clone auth handling, the gradle confirmation gate and the ARTEMIS_URL validation. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Mtze
force-pushed
the
security/no-auto-gradlew
branch
from
October 10, 2026 21:15
4f3ebef to
17874c2
Compare
This branch has not been deployed
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
Fixes four issues from the security audit of the
feat/env-var-passthroughwork. The audited code (auto-gradlew prewarm, token-in-clone-URL, Theia Bearer injection, StompJs frame logging) exists only onfeat/env-var-passthrough, not onmain, so this PR targets that branch. Basing it onmainwould not touch the vulnerable code.Changes are minimal and preserve normal UX for legitimate exercises.
1. HIGH - silent RCE via auto-executed
./gradlewwarmupGradleDaemonno longer runs the cloned repo's./gradlewwrapper automatically. The student must explicitly confirm (non-modal prompt) before any repository-controlled Gradle build runs, and confirmation defaults to no - if ignored, nothing executes.Choice: I went with explicit confirmation rather than a "trusted pinned Gradle" because any Gradle invocation against the repo (wrapper jar and
build.gradle/settings.gradle) evaluates repository-controlled code, so a pinned binary would not remove the RCE. Confirmation is the least-disruptive option that is actually safe; prewarm stays available as opt-in.2. MEDIUM - token in clone URL
.git/configand argvuser:token@hostin the clone URL (Artemis path now uses an HTTP Basic header), so it is out of the clone URL and the stored remote.GIT_CONFIG_COUNT/GIT_CONFIG_KEY_0/GIT_CONFIG_VALUE_0env vars (git >= 2.31) instead of-con the command line, so the token never appears in process arguments (ps).addVcsTokenToUrlhelper.submitCurrentWorkspace().push()), the auth header is still persisted into.git/configafter clone. A full move to an on-demand credential helper /GIT_ASKPASSwith no on-disk token is deferred (see below).3. MEDIUM - JWT logged
StompJs
debugis now a no-op, so the CONNECT frame (which carries theAuthorizationBearer JWT) is never written to the debug console.4. INFERRED - unvalidated
ARTEMIS_URLenv overrideARTEMIS_URLis validated against the configured Artemis origin (scheme + host + port) before it is used as the API base. A mismatching value is rejected with an error message, so the Bearer token cannot be redirected to an untrusted host.Tests
Added unit tests: clone auth handling (no token in argv, header via env, persisted to
.git/config), the gradle confirmation gate (no build without explicit confirm), andARTEMIS_URLvalidation.npm run build,eslint srcandtsc --noEmitare green.Deferred / product decisions
.git/configrequires reworking push/fetch to re-inject credentials on demand (e.g.GIT_ASKPASSor a credential helper). Larger change, deferred; current PR removes the URL and argv exposure.ARTEMIS_URLallowlist source (item 4): the allowlist is the configuredscorpio.artemis.apiBaseUrlorigin (packaged defaulthttps://artemis.cit.tum.de). Self-hosted deployments that pointARTEMIS_URLat a different host must ship a matchingapiBaseUrldefault, otherwise the override is rejected. Flagging in case a broader allowlist is wanted.🤖 Generated with Claude Code