fix(worker): second security pass — content-only rejection codes (resource_limit, explicit list), negative proofs of the seccomp argument filters, PR_GET_DUMPABLE self-check, strict WebP chunk structure, iCCP-bomb fixture, separate test target cache; ci: release-images builder actually used (job-level DOCKER_CONFIG, --builder), literal cleanup path, token scoped to the login step, npm advisories gate, digests from build metadata

This commit is contained in:
bchanot committed 2026-10-13 00:36:30 +02:00
1 parent 11813f5560
commit a8b644a515
12 files changed
+278 -55

No files matched your search

+8 -1
View File
@@ -100,11 +100,18 @@ pub fn apply(limits: &Limits, seccomp: bool) -> Result<(), SandboxError> {
/// `PR_SET_DUMPABLE 0` is the kernel-side stop, `RLIMIT_CORE 0` the belt.
#[allow(unsafe_code)]
fn disable_core_dumps() -> Result<(), SandboxError> {
// SAFETY: prctl(PR_SET_DUMPABLE, 0) takes no pointer and changes only this process.
// SAFETY [gated 2026-10-13]: prctl with integer arguments only, changes this process only.
let rc = unsafe { libc::prctl(libc::PR_SET_DUMPABLE, 0, 0, 0, 0) };
if rc != 0 {
return Err(SandboxError::Rlimit("PR_SET_DUMPABLE".to_owned()));
}
// SAFETY [gated 2026-10-13]: a getter with integer arguments.
let dumpable = unsafe { libc::prctl(libc::PR_GET_DUMPABLE, 0, 0, 0, 0) };
if dumpable != 0 {
return Err(SandboxError::Rlimit(format!(
"PR_GET_DUMPABLE = {dumpable}"
)));
}
rlimit::setrlimit(rlimit::Resource::CORE, 0, 0)
.map_err(|error| SandboxError::Rlimit(format!("RLIMIT_CORE: {error}")))
}