From 9ad7ac8a0ea45bcae1b53e543c7580d8733c72a9 Mon Sep 17 00:00:00 2001 From: Himanshu Pal Date: Mon, 23 Nov 2026 13:26:34 +0530 Subject: [PATCH 1/4] SK-3332 Add Java4Shell JDK evidence step and version guard, pin CodeQL to JDK 11 --- .github/workflows/codeql-analysis.yml | 11 +++ .github/workflows/codeql.yml | 11 +++ .github/workflows/contract-tests.yml | 3 + .github/workflows/endorlabsScan.yml | 3 + .github/workflows/main.yml | 3 + .github/workflows/pr.yml | 3 + .github/workflows/shared-build-and-deploy.yml | 3 + scripts/check-jdk-java4shell.sh | 70 +++++++++++++++++++ 8 files changed, 107 insertions(+) create mode 100755 scripts/check-jdk-java4shell.sh diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 081a9049..cb7b3e6d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -31,6 +31,17 @@ jobs: fetch-depth: 0 path: ./ + # Pin the JDK Autobuild uses instead of the runner image default (JDK 17 on ubuntu-latest). + # Matches pr.yml. SK-3332. + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '11' + + - name: JDK evidence and Java4Shell guard (CVE-2026-114938) + run: bash scripts/check-jdk-java4shell.sh + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9bec79c5..eae9f3d9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -48,6 +48,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + # Pin the JDK Autobuild uses instead of the runner image default (JDK 17 on ubuntu-latest). + # Matches pr.yml. SK-3332. + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '11' + + - name: JDK evidence and Java4Shell guard (CVE-2026-114938) + run: bash scripts/check-jdk-java4shell.sh + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/contract-tests.yml b/.github/workflows/contract-tests.yml index 9a3c26f7..8a77707e 100644 --- a/.github/workflows/contract-tests.yml +++ b/.github/workflows/contract-tests.yml @@ -40,6 +40,9 @@ jobs: java-version: '11' cache: 'maven' + - name: JDK evidence and Java4Shell guard (CVE-2026-114938) + run: bash scripts/check-jdk-java4shell.sh + - name: Verify API surface snapshot run: mvn -B install -pl common,${{ matrix.module }} -am -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true diff --git a/.github/workflows/endorlabsScan.yml b/.github/workflows/endorlabsScan.yml index 762b742e..7a343af9 100644 --- a/.github/workflows/endorlabsScan.yml +++ b/.github/workflows/endorlabsScan.yml @@ -21,6 +21,9 @@ jobs: distribution: zulu java-version: ${{ github.event.inputs.java_version }} + - name: JDK evidence and Java4Shell guard (CVE-2026-114938) + run: bash scripts/check-jdk-java4shell.sh + - name: Create env id: create-env run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5489eeea..4e07bf24 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,9 @@ jobs: with: java-version: '11' + - name: JDK evidence and Java4Shell guard (CVE-2026-114938) + run: bash scripts/check-jdk-java4shell.sh + - name: create-json id: create-json uses: jsdaniell/create-json@1.1.2 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 7a1cb375..5936c818 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,6 +26,9 @@ jobs: java-version: "11" cache: "maven" + - name: JDK evidence and Java4Shell guard (CVE-2026-114938) + run: bash scripts/check-jdk-java4shell.sh + - name: create-json id: create-json uses: jsdaniell/create-json@1.1.2 diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index a8ed9dd1..351062dc 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -117,6 +117,9 @@ jobs: gpg-private-key: ${{ secrets.gpg-key }} # Value of the GPG private key to import gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase + - name: JDK evidence and Java4Shell guard (CVE-2026-114938) + run: bash scripts/check-jdk-java4shell.sh + - name: Validate release branch input if: ${{ inputs.tag == 'beta' || inputs.tag == 'public' }} run: | diff --git a/scripts/check-jdk-java4shell.sh b/scripts/check-jdk-java4shell.sh new file mode 100755 index 00000000..7c9879a0 --- /dev/null +++ b/scripts/check-jdk-java4shell.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +# SK-3332 - Java4Shell (CVE-2026-114938) evidence step and version guard for CI. +# +# Logs the JDK the job is about to use (JAVA_HOME, else java on PATH), the runner CPU, +# whether the CPU has AVX-512 VBMI and the effective UseBASE64Intrinsics value. Then fails +# the job if that JDK is on an affected feature line (17, 21, 25, 27) and below the fixed +# build. JDK 8 / 11 (and anything below 17) only log evidence: the vulnerable AVX-512 +# Base64 decode intrinsic does not exist there. +# +# Fixed builds per the Adoptium CVE-2026-114938 guidance (adoptium.net, 2026-11-18): Temurin +# 17.0.21.1+2, 21.0.13.1+2, 25.0.5.1+2, 27.0.1.1+4, all GA on api.adoptium.net. JDK 8 / 11 are +# listed as not affected. Non-LTS 18-20, 22-24, 26 are not covered by any fix, so they fail closed. +set -uo pipefail + +java_bin="java" +if [ -n "${JAVA_HOME:-}" ] && [ -x "${JAVA_HOME}/bin/java" ]; then + java_bin="${JAVA_HOME}/bin/java" +fi + +runtime_version=$("$java_bin" -XshowSettings:properties -version 2>&1 \ + | awk -F' = ' '$1 ~ /^[[:space:]]*java\.runtime\.version$/ { print $2 }' | head -n1) +cpu_model=$(awk -F': ' '/^model name/ { print $2 }' /proc/cpuinfo 2>/dev/null | head -n1) +if grep -qw avx512_vbmi /proc/cpuinfo 2>/dev/null; then vbmi="present"; else vbmi="absent"; fi +# UseBASE64Intrinsics does not exist on JDK 8; the unlock flag keeps it visible if it is +# ever reclassified as diagnostic. JAVA_TOOL_OPTIONS is honoured, so a workaround shows as false. +b64=$("$java_bin" -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version 2>/dev/null \ + | awk '$2 == "UseBASE64Intrinsics" { print $4 }' | head -n1) + +echo "::group::Java4Shell (CVE-2026-114938) JDK evidence" +"$java_bin" -version 2>&1 +echo "java binary : $(command -v "$java_bin" || echo "$java_bin")" +echo "java.runtime.version : ${runtime_version:-unknown}" +echo "CPU model : ${cpu_model:-unknown}" +echo "avx512_vbmi : ${vbmi}" +echo "UseBASE64Intrinsics : ${b64:-n/a (flag not present on this JDK)}" +echo "JAVA_TOOL_OPTIONS : ${JAVA_TOOL_OPTIONS:-}" +echo "::endgroup::" + +if [ -z "$runtime_version" ]; then + echo "::error::Could not determine the JDK runtime version; refusing to continue (SK-3332)." + exit 1 +fi + +# "17.0.21.1+2-LTS" -> base "17.0.21.1", feature "17". Legacy "1.8.0_514-b09" -> feature "1". +base="${runtime_version%%[+-]*}" +feature="${base%%.*}" + +case "$feature" in + 17) min="17.0.21.1" ;; + 21) min="21.0.13.1" ;; + 25) min="25.0.5.1" ;; + 27) min="27.0.1.1" ;; + *) + if [[ "$feature" =~ ^[0-9]+$ ]] && [ "$feature" -lt 17 ]; then + echo "JDK ${runtime_version} is outside the Java4Shell affected range (17, 21, 25, 27). OK." + exit 0 + fi + # 18-20, 22-24, 26, 28+: carry the vulnerable intrinsic, or are not yet assessed, and + # have no fixed build. Pin a supported line instead. + echo "::error::JDK ${runtime_version} has no Java4Shell (CVE-2026-114938) fixed build. Use JDK 8, 11, or a patched 17/21/25/27 (SK-3332)." + exit 1 + ;; +esac + +lowest=$(printf '%s\n%s\n' "$min" "$base" | sort -V | head -n1) +if [ "$lowest" != "$min" ]; then + echo "::error::JDK ${runtime_version} is vulnerable to Java4Shell (CVE-2026-114938); ${min} or later is required. Set check-latest: true on actions/setup-java (SK-3332)." + exit 1 +fi +echo "JDK ${runtime_version} is at or above the Java4Shell fixed build ${min}. OK." From eff88f5c93411b2e35083e56dce9cb637fc21cb1 Mon Sep 17 00:00:00 2001 From: Himanshu Pal Date: Mon, 23 Nov 2026 13:49:47 +0530 Subject: [PATCH 2/4] SK-3332 Add Java4Shell guard terms to cspell dictionary --- .cspell.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.cspell.json b/.cspell.json index 955c94be..96b90257 100644 --- a/.cspell.json +++ b/.cspell.json @@ -7,6 +7,10 @@ ], "words": [ "japicmp", + "Adoptium", + "Temurin", + "vbmi", + "Xshow", "Skyflow", "skyflow", "skyflowapi", From da5f94ca005e44ad27f77cebb3aa200f25fe472a Mon Sep 17 00:00:00 2001 From: Himanshu Pal Date: Mon, 23 Nov 2026 14:10:17 +0530 Subject: [PATCH 3/4] SK-3332 Fix AVX-512 VBMI CPU flag detection in JDK guard --- scripts/check-jdk-java4shell.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/check-jdk-java4shell.sh b/scripts/check-jdk-java4shell.sh index 7c9879a0..b4af4d50 100755 --- a/scripts/check-jdk-java4shell.sh +++ b/scripts/check-jdk-java4shell.sh @@ -20,7 +20,8 @@ fi runtime_version=$("$java_bin" -XshowSettings:properties -version 2>&1 \ | awk -F' = ' '$1 ~ /^[[:space:]]*java\.runtime\.version$/ { print $2 }' | head -n1) cpu_model=$(awk -F': ' '/^model name/ { print $2 }' /proc/cpuinfo 2>/dev/null | head -n1) -if grep -qw avx512_vbmi /proc/cpuinfo 2>/dev/null; then vbmi="present"; else vbmi="absent"; fi +# Linux names this CPU flag "avx512vbmi" (no underscore; only avx512_vbmi2 has one). +if grep -qwE "avx512vbmi|avx512_vbmi" /proc/cpuinfo 2>/dev/null; then vbmi="present"; else vbmi="absent"; fi # UseBASE64Intrinsics does not exist on JDK 8; the unlock flag keeps it visible if it is # ever reclassified as diagnostic. JAVA_TOOL_OPTIONS is honoured, so a workaround shows as false. b64=$("$java_bin" -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version 2>/dev/null \ From 3326d76f8aed308f1564acf915f5ae0204024539 Mon Sep 17 00:00:00 2001 From: yaswanth-pula-skyflow Date: Wed, 25 Nov 2026 19:56:12 +0530 Subject: [PATCH 4/4] SK-3332 Remove Java4Shell guard script and evidence steps All Java jobs here run JDK 11, which is not affected, so the guard can never fail. Removes the script, its workflow steps and the related cspell words. The CodeQL JDK 11 pin is left as is. Co-Authored-By: Claude Fable 5.2 --- .cspell.json | 4 -- .github/workflows/codeql-analysis.yml | 3 - .github/workflows/codeql.yml | 3 - .github/workflows/contract-tests.yml | 3 - .github/workflows/endorlabsScan.yml | 3 - .github/workflows/main.yml | 3 - .github/workflows/pr.yml | 3 - .github/workflows/shared-build-and-deploy.yml | 3 - scripts/check-jdk-java4shell.sh | 71 ------------------- 9 files changed, 96 deletions(-) delete mode 100755 scripts/check-jdk-java4shell.sh diff --git a/.cspell.json b/.cspell.json index 96b90257..955c94be 100644 --- a/.cspell.json +++ b/.cspell.json @@ -7,10 +7,6 @@ ], "words": [ "japicmp", - "Adoptium", - "Temurin", - "vbmi", - "Xshow", "Skyflow", "skyflow", "skyflowapi", diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index cb7b3e6d..26444965 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,9 +39,6 @@ jobs: distribution: 'temurin' java-version: '11' - - name: JDK evidence and Java4Shell guard (CVE-2026-114938) - run: bash scripts/check-jdk-java4shell.sh - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index eae9f3d9..19fa4beb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -56,9 +56,6 @@ jobs: distribution: 'temurin' java-version: '11' - - name: JDK evidence and Java4Shell guard (CVE-2026-114938) - run: bash scripts/check-jdk-java4shell.sh - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/contract-tests.yml b/.github/workflows/contract-tests.yml index 8a77707e..9a3c26f7 100644 --- a/.github/workflows/contract-tests.yml +++ b/.github/workflows/contract-tests.yml @@ -40,9 +40,6 @@ jobs: java-version: '11' cache: 'maven' - - name: JDK evidence and Java4Shell guard (CVE-2026-114938) - run: bash scripts/check-jdk-java4shell.sh - - name: Verify API surface snapshot run: mvn -B install -pl common,${{ matrix.module }} -am -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true diff --git a/.github/workflows/endorlabsScan.yml b/.github/workflows/endorlabsScan.yml index 7a343af9..762b742e 100644 --- a/.github/workflows/endorlabsScan.yml +++ b/.github/workflows/endorlabsScan.yml @@ -21,9 +21,6 @@ jobs: distribution: zulu java-version: ${{ github.event.inputs.java_version }} - - name: JDK evidence and Java4Shell guard (CVE-2026-114938) - run: bash scripts/check-jdk-java4shell.sh - - name: Create env id: create-env run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e07bf24..5489eeea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,9 +15,6 @@ jobs: with: java-version: '11' - - name: JDK evidence and Java4Shell guard (CVE-2026-114938) - run: bash scripts/check-jdk-java4shell.sh - - name: create-json id: create-json uses: jsdaniell/create-json@1.1.2 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5936c818..7a1cb375 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,9 +26,6 @@ jobs: java-version: "11" cache: "maven" - - name: JDK evidence and Java4Shell guard (CVE-2026-114938) - run: bash scripts/check-jdk-java4shell.sh - - name: create-json id: create-json uses: jsdaniell/create-json@1.1.2 diff --git a/.github/workflows/shared-build-and-deploy.yml b/.github/workflows/shared-build-and-deploy.yml index 351062dc..a8ed9dd1 100644 --- a/.github/workflows/shared-build-and-deploy.yml +++ b/.github/workflows/shared-build-and-deploy.yml @@ -117,9 +117,6 @@ jobs: gpg-private-key: ${{ secrets.gpg-key }} # Value of the GPG private key to import gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase - - name: JDK evidence and Java4Shell guard (CVE-2026-114938) - run: bash scripts/check-jdk-java4shell.sh - - name: Validate release branch input if: ${{ inputs.tag == 'beta' || inputs.tag == 'public' }} run: | diff --git a/scripts/check-jdk-java4shell.sh b/scripts/check-jdk-java4shell.sh deleted file mode 100755 index b4af4d50..00000000 --- a/scripts/check-jdk-java4shell.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash -# SK-3332 - Java4Shell (CVE-2026-114938) evidence step and version guard for CI. -# -# Logs the JDK the job is about to use (JAVA_HOME, else java on PATH), the runner CPU, -# whether the CPU has AVX-512 VBMI and the effective UseBASE64Intrinsics value. Then fails -# the job if that JDK is on an affected feature line (17, 21, 25, 27) and below the fixed -# build. JDK 8 / 11 (and anything below 17) only log evidence: the vulnerable AVX-512 -# Base64 decode intrinsic does not exist there. -# -# Fixed builds per the Adoptium CVE-2026-114938 guidance (adoptium.net, 2026-11-18): Temurin -# 17.0.21.1+2, 21.0.13.1+2, 25.0.5.1+2, 27.0.1.1+4, all GA on api.adoptium.net. JDK 8 / 11 are -# listed as not affected. Non-LTS 18-20, 22-24, 26 are not covered by any fix, so they fail closed. -set -uo pipefail - -java_bin="java" -if [ -n "${JAVA_HOME:-}" ] && [ -x "${JAVA_HOME}/bin/java" ]; then - java_bin="${JAVA_HOME}/bin/java" -fi - -runtime_version=$("$java_bin" -XshowSettings:properties -version 2>&1 \ - | awk -F' = ' '$1 ~ /^[[:space:]]*java\.runtime\.version$/ { print $2 }' | head -n1) -cpu_model=$(awk -F': ' '/^model name/ { print $2 }' /proc/cpuinfo 2>/dev/null | head -n1) -# Linux names this CPU flag "avx512vbmi" (no underscore; only avx512_vbmi2 has one). -if grep -qwE "avx512vbmi|avx512_vbmi" /proc/cpuinfo 2>/dev/null; then vbmi="present"; else vbmi="absent"; fi -# UseBASE64Intrinsics does not exist on JDK 8; the unlock flag keeps it visible if it is -# ever reclassified as diagnostic. JAVA_TOOL_OPTIONS is honoured, so a workaround shows as false. -b64=$("$java_bin" -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version 2>/dev/null \ - | awk '$2 == "UseBASE64Intrinsics" { print $4 }' | head -n1) - -echo "::group::Java4Shell (CVE-2026-114938) JDK evidence" -"$java_bin" -version 2>&1 -echo "java binary : $(command -v "$java_bin" || echo "$java_bin")" -echo "java.runtime.version : ${runtime_version:-unknown}" -echo "CPU model : ${cpu_model:-unknown}" -echo "avx512_vbmi : ${vbmi}" -echo "UseBASE64Intrinsics : ${b64:-n/a (flag not present on this JDK)}" -echo "JAVA_TOOL_OPTIONS : ${JAVA_TOOL_OPTIONS:-}" -echo "::endgroup::" - -if [ -z "$runtime_version" ]; then - echo "::error::Could not determine the JDK runtime version; refusing to continue (SK-3332)." - exit 1 -fi - -# "17.0.21.1+2-LTS" -> base "17.0.21.1", feature "17". Legacy "1.8.0_514-b09" -> feature "1". -base="${runtime_version%%[+-]*}" -feature="${base%%.*}" - -case "$feature" in - 17) min="17.0.21.1" ;; - 21) min="21.0.13.1" ;; - 25) min="25.0.5.1" ;; - 27) min="27.0.1.1" ;; - *) - if [[ "$feature" =~ ^[0-9]+$ ]] && [ "$feature" -lt 17 ]; then - echo "JDK ${runtime_version} is outside the Java4Shell affected range (17, 21, 25, 27). OK." - exit 0 - fi - # 18-20, 22-24, 26, 28+: carry the vulnerable intrinsic, or are not yet assessed, and - # have no fixed build. Pin a supported line instead. - echo "::error::JDK ${runtime_version} has no Java4Shell (CVE-2026-114938) fixed build. Use JDK 8, 11, or a patched 17/21/25/27 (SK-3332)." - exit 1 - ;; -esac - -lowest=$(printf '%s\n%s\n' "$min" "$base" | sort -V | head -n1) -if [ "$lowest" != "$min" ]; then - echo "::error::JDK ${runtime_version} is vulnerable to Java4Shell (CVE-2026-114938); ${min} or later is required. Set check-latest: true on actions/setup-java (SK-3332)." - exit 1 -fi -echo "JDK ${runtime_version} is at or above the Java4Shell fixed build ${min}. OK."