{"record":{"id":"86debcdfe3943e82","repo":"BigPizzaV3/CodexPlusPlus","slug":"name","errorCode":null,"errorMessage":"主题包包含加密内容或链接：{name}","messagePattern":"主题包包含加密内容或链接：(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":109,"sourceCode":"    if bytes.is_empty() || bytes.len() > PACKAGE_LIMIT {\n        bail!(\"Dream Skin 主题包超过 32 MiB 限制\");\n    }\n    let mut archive =\n        ZipArchive::new(Cursor::new(bytes)).context(\"Dream Skin 主题包不是有效 ZIP\")?;\n    if archive.len() == 0 || archive.len() > FILE_LIMIT {\n        bail!(\"Dream Skin 主题包文件数量必须在 1 到 32 之间\");\n    }\n\n    let mut entries = Vec::new();\n    let mut unpacked = 0usize;\n    for index in 0..archive.len() {\n        let file = archive\n            .by_index(index)\n            .context(\"读取 Dream Skin ZIP 条目失败\")?;\n        let name = file.name().to_string();\n        validate_archive_entry_name(&name)?;\n        if file.encrypted() || file.is_symlink() {\n            bail!(\"主题包包含加密内容或链接：{name}\");\n        }\n        if file.is_dir() {\n            entries.push((name, None));\n            continue;\n        }\n        let base_name = name.rsplit('/').next().unwrap_or_default();\n        if base_name == \".DS_Store\" || name.starts_with(\"__MACOSX/\") {\n            entries.push((name, None));\n            continue;\n        }\n        if !ALLOWED_FILES.contains(&base_name) {\n            bail!(\"主题包包含不支持的文件：{name}\");\n        }\n        let limit = file_limit(base_name);\n        let mut content = Vec::new();\n        file.take((limit + 1) as u64)\n            .read_to_end(&mut content)\n            .context(\"读取 Dream Skin ZIP 内容失败\")?;","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_package.rs#L91-L127","documentation":"Each ZIP entry is checked: encrypted entries (encrypted()) and symlinks (is_symlink()) are rejected with the entry name embedded in the message. The library refuses packages containing encrypted content or filesystem links to prevent unsafe or uninspectable payloads.","triggerScenarios":"A package contains any entry created with ZIP encryption/password protection, or a symlink entry, and validate_and_read_package reads that entry.","commonSituations":"Author password-protected the archive or individual files; packaging on Unix with `zip -y` including symlinks; build systems emitting symlink entries for assets.","solutions":["Repackage without encryption — do not password-protect theme files","Exclude symlinks when creating the archive (`zip -r theme.zip . -x` and avoid -y; dereference with -L or copy real files)","Replace each symlink with the actual file it points to before zipping","Identify the offending entry from the error message and remove/recreate it"],"exampleFix":"// before\nzip -ry theme.zip assets/   # keeps symlinks\n// after\nzip -rL theme.zip assets/   # dereferences symlinks, no encryption","handlingStrategy":"validation","validationCode":"let mut archive = ZipArchive::new(Cursor::new(&bytes))?;\nfor i in 0..archive.len() {\n    let f = archive.by_index(i)?;\n    if f.encrypted() || f.is_symlink() {\n        return Err(EncryptedOrSymlink(f.name().to_string()));\n    }\n}","typeGuard":null,"tryCatchPattern":"match validate_and_read_package(&bytes, platform) {\n    Err(e) if e.to_string().contains(\"加密内容或链接\") => {\n        Err(UserFacingError::UnsupportedArchiveEntry)\n    }\n    other => other,\n}","preventionTips":["Never password-protect theme archives","Package with symlink dereferencing (zip -L) or copy real files first","Run a pre-publish validation pass on every package"],"tags":["security","zip","validation"],"backgroundTag":"path-traversal-blocked","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}