{"record":{"id":"ce6c1055d02cd949","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-ce6c10","errorCode":null,"errorMessage":"主题市场资源地址越界","messagePattern":"主题市场资源地址越界","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_market.rs","lineNumber":338,"sourceCode":"    let bytes = serde_json::to_vec_pretty(&records)?;\n    crate::settings::atomic_write(&state_dir.join(MARKET_INSTALLS_FILE), &bytes)\n}\n\nfn market_download_path(state_dir: &Path, id: &str, extension: &str) -> anyhow::Result<PathBuf> {\n    if !valid_theme_id(id) || !matches!(extension, \"png\" | \"jpg\" | \"gif\" | \"bmp\" | \"webp\") {\n        bail!(\"无效的市场主题下载文件名\");\n    }\n    Ok(state_dir\n        .join(\"dream-skin/market/downloads\")\n        .join(format!(\"{id}.{extension}\")))\n}\n\nfn market_asset_url(base_url: &str, relative: &str) -> anyhow::Result<String> {\n    validate_market_path(relative)?;\n    let base = reqwest::Url::parse(base_url).context(\"主题市场基础地址无效\")?;\n    let joined = base.join(relative).context(\"主题市场资源地址无效\")?;\n    if joined.scheme() != base.scheme() || joined.host_str() != base.host_str() {\n        bail!(\"主题市场资源地址越界\");\n    }\n    Ok(joined.to_string())\n}\n\nfn validate_market_path(value: &str) -> anyhow::Result<()> {\n    if value.is_empty()\n        || value.len() > 256\n        || value.starts_with('/')\n        || value.contains('\\\\')\n        || value.contains(['?', '#', '\\0'])\n    {\n        bail!(\"无效的主题市场相对路径\");\n    }\n    for segment in value.split('/') {\n        if segment.is_empty()\n            || matches!(segment, \".\" | \"..\")\n            || !segment\n                .bytes()","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_market.rs#L320-L356","documentation":"Security guard in market_asset_url: joining the relative path onto the base URL produced a URL with a different scheme or host than the base. This blocks absolute URLs or traversal tricks inside manifest fields from redirecting downloads to third-party servers.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_market.rs:338 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a plain relative path in the manifest field","Fix the manifest entry that embeds a foreign-host URL"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}