{"record":{"id":"14b8afc1da4138be","repo":"Universal-Debloater-Alliance/universal-android-debloater-next-generation","slug":"remote-list-is-bigger-than-8mib","errorCode":null,"errorMessage":"remote list is bigger than 8MiB","messagePattern":"remote list is bigger than 8MiB","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uad-core/src/uad_lists.rs","lineNumber":230,"sourceCode":"            match ureq::get(format!(\n                \"https://raw.githubusercontent.com\\\n                    /Universal-Debloater-Alliance\\\n                    /universal-android-debloater\\\n                    /main\\\n                    /resources\\\n                    /assets\\\n                    /{LIST_FNAME}\"\n            ))\n            .call()\n            {\n                Ok(mut data) => {\n                    // https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation/discussions/608\n                    let text = data\n                        .body_mut()\n                        .with_config()\n                        .limit(1 << (3 + 10 + 10))\n                        .read_to_string()\n                        .expect(\"remote list is bigger than 8MiB\");\n                    fs::write(cached_uad_lists.clone(), &text).expect(\"Unable to write file\");\n                    let list: PackageHashMap =\n                        serde_json::from_str(&text).expect(\"Unable to parse\");\n                    OperationResult::Ok(list)\n                }\n                Err(e) => {\n                    warn!(\"Could not load remote debloat list: {e}\");\n                    error = true;\n                    OperationResult::Retry(PackageHashMap::new())\n                }\n            }\n        })\n        .unwrap_or_else(|_| get_local_lists())\n    } else {\n        warn!(\"Could not load remote debloat list\");\n        get_local_lists()\n    };\n","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation/blob/64465c850c7ed36329e67165ac08501abffb218e/crates/uad-core/src/uad_lists.rs#L212-L248","documentation":"load_debloat_lists downloads the remote debloat list JSON via an HTTP client whose body reader is configured with an 8 MiB limit (1 << 20 * 8). If the remote response exceeds that limit, the reader returns an error and `.expect(\"remote list is bigger than 8MiB\")` panics. It is a deliberate size guard: the app refuses to consume an unexpectedly huge (or hostile) remote list.","triggerScenarios":"Calling load_debloat_lists (directly or via update_lists / list_packages / init_apps_view) when the remote list endpoint serves a body larger than 8 MiB — e.g. the upstream list file has grown past 8 MiB, a mirror/proxy returns an error page or concatenated content, or DNS/captive-portal redirects the request to an HTML page that balloons the body.","commonSituations":"A UAD release used long after the remote debloat list grew beyond the hard-coded 8 MiB cap; corporate proxies intercepting the request and returning large HTML; a user pointing the list URL at a different, much larger JSON file.","solutions":["Bump the limit, e.g. `.limit(1 << (4 + 10 + 10))` (16 MiB) or make it configurable, to track the real list size.","Handle the body-read error instead of expecting: return OperationResult::Retry with a warn! so the app falls back to the cached list.","Stream the response to disk with a cap rather than reading the whole body into a String.","Pin/check the remote list URL is the official endpoint and not a redirect target."],"exampleFix":"// before\n.read_to_string()\n.expect(\"remote list is bigger than 8MiB\");\n// after\n.read_to_string()\n.unwrap_or_else(|e| {\n    warn!(\"Failed to read remote list (limit 8MiB): {e}\");\n    String::new()\n})","handlingStrategy":"fallback","validationCode":"let resp = reqwest::get(LIST_URL).await?;\nlet len = resp.content_length().unwrap_or(0);\nif len > 8 * 1024 * 1024 {\n    eprintln!(\"remote list too large: {len} bytes; falling back to cache\");\n}","typeGuard":null,"tryCatchPattern":"match data.body_mut().with_config().limit(8 * 1024 * 1024).read_to_string() {\n    Ok(text) => cache_and_use(&text),\n    Err(e) => { warn!(\"remote list unreadable/oversized: {e}\"); use_cached_list() }\n}","preventionTips":["Treat the 8 MiB reader cap as a data-dependent constant; re-check it when the upstream list grows.","Always pair remote-list fetch with a cached fallback path.","Check Content-Length before reading a remote body."],"tags":["panic","network","size-limit","http"],"backgroundTag":"payload-too-large","analyzedSha":"64465c850c7ed36329e67165ac08501abffb218e","analyzedAt":"2026-09-12T09:09:23.137Z","contentChangedAt":"2026-09-12T09:09:23.137Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}