Exploit databaseDownload repository ZIP
GH-31a603a3ee6a70adbe1481180eb9a0cf
stuartmoorhouse/cve-2026-4342
Sources for CVE-2026-4342
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files6
stuartmoorhouse/cve-2026-4342Revision 9dd48f70388d
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
scripts/verify.sh
Shell · 2,213 bytes#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
KUBECONFIG_PATH="$PROJECT_DIR/shared/kubeconfig.yaml"
if [[ ! -f "$KUBECONFIG_PATH" ]]; then
echo "FAIL: Kubeconfig not found at $KUBECONFIG_PATH"
exit 1
fi
export KUBECONFIG="$KUBECONFIG_PATH"
PASS=0
FAIL=0
check() {
local desc="$1"
local result="$2"
if [[ "$result" == "true" ]]; then
echo " PASS: $desc"
PASS=$((PASS + 1))
else
echo " FAIL: $desc"
FAIL=$((FAIL + 1))
fi
}
echo "=== Acceptance Criteria Verification ==="
echo ""
# 1. Node is Ready on 1.31.x
NODE_READY=$(kubectl get nodes -o jsonpath='{.items[0].status.conditions[?(@.type=="Ready")].status}' 2>/dev/null || echo "")
NODE_VERSION=$(kubectl get nodes -o jsonpath='{.items[0].status.nodeInfo.kubeletVersion}' 2>/dev/null || echo "")
check "Node is Ready" "$( [[ "$NODE_READY" == "True" ]] && echo true || echo false )"
check "Node is K8s 1.31.x ($NODE_VERSION)" "$( [[ "$NODE_VERSION" == v1.31* ]] && echo true || echo false )"
# 2. ingress-nginx controller running with v1.15.0
NGINX_RUNNING=$(kubectl get deployment ingress-nginx-controller -n ingress-nginx -o jsonpath='{.status.readyReplicas}' 2>/dev/null || echo "0")
NGINX_IMAGE=$(kubectl get deployment ingress-nginx-controller -n ingress-nginx -o jsonpath='{.spec.template.spec.containers[0].image}' 2>/dev/null || echo "")
check "ingress-nginx controller is running" "$( [[ "$NGINX_RUNNING" -ge 1 ]] && echo true || echo false )"
check "ingress-nginx is v1.15.0 ($NGINX_IMAGE)" "$( [[ "$NGINX_IMAGE" == *"v1.15.0"* ]] && echo true || echo false )"
# 3. Test secrets exist
check "Secret default/test-secret-default exists" "$( kubectl get secret test-secret-default -n default &>/dev/null && echo true || echo false )"
check "Secret kube-system/test-secret-system exists" "$( kubectl get secret test-secret-system -n kube-system &>/dev/null && echo true || echo false )"
check "Secret target-ns/test-secret-target exists" "$( kubectl get secret test-secret-target -n target-ns &>/dev/null && echo true || echo false )"
echo ""
echo "=== Results: $PASS passed, $FAIL failed ==="
if [[ $FAIL -gt 0 ]]; then
exit 1
fi