Commit 28b8fac
Roy Lin
fix(security): confine CRI localhostProfile seccomp path to the seccomp root
LOW. `parse_localhost_seccomp_deny` did `std::fs::read_to_string(localhost_ref)`
with no path confinement. `localhost_ref` is the pod's
`securityContext.seccompProfile.localhostProfile` — attacker-settable through the
CRI by anyone who can create pods — so it was an arbitrary host-file OPEN
primitive (a path-traversal / file-existence oracle). Information disclosure is
limited (the parse error is only warn-logged, never returned to the gRPC caller,
and content only escapes as syscall names from valid OCI-seccomp JSON into the
attacker's own container), hence LOW — but the missing guard is real.
Fix: `confined_seccomp_path` mirrors kubelet/containerd semantics — resolve the
ref under the configured seccomp root (default /var/lib/kubelet/seccomp, override
A3S_BOX_SECCOMP_PROFILE_ROOT), reject any `..` component, and require an absolute
ref to lie within the root. An out-of-root or traversing ref is rejected, and the
caller falls back to RuntimeDefault (never unconfined).
Test: confines_localhost_profile_to_root_and_rejects_traversal — accepts
in-root relative/absolute refs; rejects `../../etc/passwd`, `sub/../../escape`,
`/etc/passwd`, `/etc/shadow`, and `/var/lib/kubelet/seccomp-evil/x`
(prefix-confusion). Neuter-verified on the KVM server (disabling the
root check makes it FAIL on /etc/passwd); fmt + clippy clean.
Completes the untrusted-input security audit (4/4): after #141 (CRITICAL digest
traversal), #142 (HIGH/MED bombs), #140 (HIGH whiteout deletion).1 parent 4437d06 commit 28b8fac
1 file changed
Lines changed: 70 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
213 | 250 | | |
214 | 251 | | |
215 | 252 | | |
| |||
219 | 256 | | |
220 | 257 | | |
221 | 258 | | |
222 | | - | |
223 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
224 | 262 | | |
225 | 263 | | |
226 | 264 | | |
| |||
249 | 287 | | |
250 | 288 | | |
251 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
252 | 320 | | |
253 | 321 | | |
254 | 322 | | |
| |||
0 commit comments