Skip to content

Commit 1722df8

Browse files
Copilotneargle
andauthored
docs: clarify copy-fail-cve-2026-31431 is privilege escalation only, not container escape
Agent-Logs-Url: https://github.com/cdk-team/CDK/sessions/a58f8e00-3f3f-4260-ba35-7892ec73f480 Co-authored-by: neargle <7868679+neargle@users.noreply.github.com>
1 parent 5a890be commit 1722df8

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ cdk run <script-name> [options]
160160
| Credential Access | Dump K8s Secrets | k8s-secret-dump ||| [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-secret-dump) |
161161
| Credential Access | Dump K8s Config | k8s-configmap-dump ||| [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-configmap-dump) |
162162
| Privilege Escalation | K8s RBAC Bypass | k8s-get-sa-token ||| [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-get-sa-token) |
163+
| 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) |
163164
| Persistence | Deploy WebShell | webshell-deploy ||| [link](https://github.com/cdk-team/CDK/wiki/Exploit:-webshell-deploy) |
164165
| Persistence | Deploy Backdoor Pod | k8s-backdoor-daemonset ||| [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-backdoor-daemonset) |
165166
| Persistence | Deploy Shadow K8s api-server | k8s-shadow-apiserver ||| [link](https://github.com/cdk-team/CDK/wiki/Exploit:-k8s-shadow-apiserver) |

pkg/exploit/privilege_escalation/copy_fail_cve_2026_31431.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ package privilege_escalation
2222
// CVE-2026-31431 "copy-fail" privilege escalation exploit.
2323
// Ported from https://github.com/theori-io/copy-fail-CVE-2026-31431/blob/main/copy_fail_exp.py
2424
//
25+
// IMPORTANT: This exploit performs LOCAL PRIVILEGE ESCALATION only (non-root → root
26+
// inside the container). It does NOT escape the container or affect the host.
27+
// You must already have a non-root shell inside the container to use it.
28+
//
2529
// The exploit abuses a bug in the interaction between AF_ALG AEAD sockets and
2630
// the splice/pipe subsystem. By sending a payload via sendmsg(MSG_MORE) and
2731
// then splicing read-only file pages into the same socket's pipe buffers, the
@@ -237,7 +241,9 @@ func CopyFailExploit(targetBin string) error {
237241
type copyFailCVE202631431S struct{ base.BaseExploit }
238242

239243
func (p copyFailCVE202631431S) Desc() string {
240-
return "Overwrite SUID binary page cache via CVE-2026-31431 (AF_ALG + splice). " +
244+
return "CVE-2026-31431 (copy-fail): local privilege escalation from non-root to root " +
245+
"inside the container by overwriting a SUID binary's page cache via AF_ALG + splice. " +
246+
"NOTE: this exploit does NOT escape the container. " +
241247
"Usage: ./cdk run copy-fail-cve-2026-31431 [/usr/bin/su]"
242248
}
243249

@@ -250,6 +256,7 @@ func (p copyFailCVE202631431S) Run() bool {
250256
}
251257

252258
log.Printf("[*] CVE-2026-31431 copy-fail exploit targeting %s\n", targetBin)
259+
log.Println("[*] NOTE: This exploit performs local privilege escalation (non-root → root) inside the container only. It does NOT escape the container.")
253260
if err := CopyFailExploit(targetBin); err != nil {
254261
log.Printf("[-] Exploit failed: %v\n", err)
255262
return false

0 commit comments

Comments
 (0)