Skip to content

Fix stored XSS→RCE in OfflineCause.UserCause and auth bypass in RunParameterValue#4

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-remote-code-execution-vulnerability
Draft

Fix stored XSS→RCE in OfflineCause.UserCause and auth bypass in RunParameterValue#4
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-remote-code-execution-vulnerability

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 18, 2026

Backports SECURITY-3669 and SECURITY-3658 fixes missing from this fork (upstream patched 2026-02-15, fork base is 2026-02-10).

SECURITY-3669: Stored XSS → RCE via OfflineCause.UserCause

UserCause.toString() and getMessage() rendered user-controlled offline messages without HTML escaping. Any user with Computer.DISCONNECT (granted to all authenticated users under "Logged-in users can do anything") can inject persistent XSS that fires when an admin views any node page, chaining to RCE via /script:

POST /computer/(built-in)/toggleOffline
offlineMessage=<img src=x onerror="fetch('/script',{method:'POST',body:'script=...'})">

Fix: Wrap both methods with Util.escape():

public String getMessage() {
    return Util.escape(message);
}

@Override
public String toString() {
    return Util.escape(super.toString());
}

CVSS 8.8 — AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

SECURITY-3658: Authorization bypass in RunParameterValue

RunParameterValue accepted arbitrary runId values without verifying the referenced run exists or is accessible. Users with Item.BUILD on one project could reference builds in projects they lack Item.READ on, leaking display names, URLs, and results via environment variables.

Fix: Added existence check via Run.fromExternalizableId() in constructor, which respects ACL. Escape hatch: -Dhudson.model.RunParameterValue.SKIP_EXISTENCE_CHECK=true.

Changes

  • OfflineCause.java — HTML-escape UserCause.toString() and getMessage()
  • RunParameterValue.java — Validate referenced run exists and is accessible at construction time
  • Updated OfflineCauseTest with XSS escaping assertions
  • Updated RunParameterValueTest to account for existence check; added RunParameterValueIntegrationTest with @WithJenkins

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.jenkins-ci.org
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -Xmx1400m -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/jenkins/jenkins org.codehaus.plexus.classworlds.launcher.Launcher test -pl core -Dtest=hudson.slaves.OfflineCauseTest -DfailIfNoTests=false -q ic void doScriptsh java/jenkins/mod-c (dns block)
  • www.jenkins.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix critical remote code execution vulnerability Fix stored XSS→RCE in OfflineCause.UserCause and auth bypass in RunParameterValue Feb 18, 2026
Copilot AI requested a review from DominicBreuker February 18, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants