Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
],
"words": [
"japicmp",
"Adoptium",
"Temurin",
"vbmi",
"Xshow",
"Skyflow",
"skyflow",
"skyflowapi",
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/endorlabsScan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/shared-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
71 changes: 71 additions & 0 deletions scripts/check-jdk-java4shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/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:-<unset>}"
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."
Loading