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:
1 parent
11813f5560
commit
a8b644a515
12 files changed
+278
-55
No files matched your search
@@ -13,11 +13,18 @@ pub const DIMENSIONS: i32 = 15;
|
||||
pub const ENCODE_FAILED: i32 = 16;
|
||||
pub const OUTPUT_FAILED: i32 = 17;
|
||||
pub const INTERNAL: i32 = 18;
|
||||
/// The decoders' allocation or complexity budget was exceeded by the content.
|
||||
pub const RESOURCE_LIMIT: i32 = 19;
|
||||
|
||||
/// Codes that judge the content (the upload is refused); every other non-zero code means
|
||||
/// the child's environment is broken and the parent must alert rather than reject.
|
||||
/// Codes that judge the content (the upload is refused). Every other non-zero code means
|
||||
/// the child's environment is broken (`Broken` outcome: the parent alerts rather than
|
||||
/// rejects). Explicit list on purpose: a new code never lands in the wrong class by
|
||||
/// accident, and no content can produce a "broken" code.
|
||||
pub fn is_content_rejection(code: i32) -> bool {
|
||||
(INPUT_TOO_LARGE..=OUTPUT_FAILED).contains(&code)
|
||||
matches!(
|
||||
code,
|
||||
INPUT_TOO_LARGE | UNSUPPORTED_TYPE | DECODE_FAILED | DIMENSIONS | RESOURCE_LIMIT
|
||||
)
|
||||
}
|
||||
|
||||
/// Stable name of an exit code for logs and tests.
|
||||
@@ -34,6 +41,7 @@ pub fn name(code: i32) -> &'static str {
|
||||
ENCODE_FAILED => "encode_failed",
|
||||
OUTPUT_FAILED => "output_failed",
|
||||
INTERNAL => "internal",
|
||||
RESOURCE_LIMIT => "resource_limit",
|
||||
_ => "unknown",
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user