{"record":{"id":"8447fb0595d3c8f0","repo":"openai/codex","slug":"invalidinput-8447fb","errorCode":"InvalidInput","errorMessage":"descriptor-backed mount must contain FD:DEST: {mount}","messagePattern":"descriptor-backed mount must contain FD:DEST: (.+?)","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/linux-sandbox/src/fd_mount.rs","lineNumber":17,"sourceCode":"//! Authenticate descriptor-backed mounts before sandboxed code can inherit them.\n\nuse std::collections::HashSet;\nuse std::fs;\nuse std::fs::File;\nuse std::io;\nuse std::os::fd::AsRawFd;\nuse std::os::fd::FromRawFd;\nuse std::os::unix::fs::MetadataExt;\nuse std::path::Path;\n\npub(crate) fn verify_fd_mounts(mounts: &[String]) -> io::Result<()> {\n    let mut claimed_descriptors = HashSet::with_capacity(mounts.len());\n\n    for mount in mounts {\n        let (descriptor, destination) = mount.split_once(':').ok_or_else(|| {\n            io::Error::new(\n                io::ErrorKind::InvalidInput,\n                format!(\"descriptor-backed mount must contain FD:DEST: {mount}\"),\n            )\n        })?;\n        let descriptor = descriptor.parse::<libc::c_int>().map_err(|_| {\n            io::Error::new(\n                io::ErrorKind::InvalidInput,\n                format!(\"descriptor-backed mount has an invalid descriptor: {mount}\"),\n            )\n        })?;\n        if descriptor <= libc::STDERR_FILENO {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidInput,\n                format!(\"descriptor-backed mount cannot use a standard descriptor: {descriptor}\"),\n            ));\n        }\n        if !claimed_descriptors.insert(descriptor) {\n            return Err(io::Error::new(","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/linux-sandbox/src/fd_mount.rs#L1-L35","documentation":"Thrown by verify_fd_mounts in codex-rs/linux-sandbox/src/fd_mount.rs, the trusted inner stage of the Codex Linux sandbox. Each --verify-fd-mount value must be a single FD:DEST pair; the function splits on the first colon via split_once and rejects the whole value with ErrorKind::InvalidInput when no colon is present, because it cannot identify which descriptor to authenticate. The check runs before any descriptor is adopted, so a malformed pair never reaches bubblewrap mount setup.","triggerScenarios":"Running codex-linux-sandbox with --verify-fd-mount /tmp/socket-root (destination only), --verify-fd-mount 7tmp/dest, or any value where split_once(':') returns None. In practice this comes from a hand-built argv or launcher code that formats the pair without the ':' separator.","commonSituations":"Hand-testing the sandbox binary with edited flags; a code path that concatenates fd and destination without the colon; a templating bug that drops the fd field entirely.","solutions":["Reformat the value as FD:DEST, e.g. --verify-fd-mount 7:/tmp/socket-root","Build the pair in one place with format!(\"{fd}:{dest}\") so the separator cannot be lost","Drive the sandbox through the crate launcher (exec_bwrap) instead of invoking the inner stage by hand; it emits well-formed --verify-fd-mount pairs","Add a CI assertion over the exact argv you assemble"],"exampleFix":"// before\n--verify-fd-mount /tmp/socket-root\n\n// after\n--verify-fd-mount 7:/tmp/socket-root","handlingStrategy":"validation","validationCode":"fn fd_mount_has_pair(value: &str) -> bool {\n    value.split_once(':').is_some()\n}\n\nfor m in &mounts {\n    if !fd_mount_has_pair(m) {\n        return Err(format!(\"mount spec missing FD:DEST separator: {m}\"));\n    }\n}","typeGuard":"fn is_fd_mount_pair(value: &str) -> bool {\n    value.split_once(':').is_some()\n}","tryCatchPattern":"match verify_fd_mounts(&mounts) {\n    Ok(()) => {}\n    Err(e) if e.kind() == std::io::ErrorKind::InvalidInput => {\n        eprintln!(\"invalid fd mount spec: {e}\");\n        std::process::exit(libc::EXIT_FAILURE);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Derive FD:DEST pairs with a single format! call instead of string surgery","Smoke-test the sandbox argv in CI","Never hand-edit --verify-fd-mount values"],"tags":["linux-sandbox","bubblewrap","argument-validation","rust"],"backgroundTag":"invalid-argument-format","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}