{"record":{"id":"f0f3a7bd29db7292","repo":"Pumpkin-MC/Pumpkin","slug":"unknown-item-descriptor-type-descriptor-type","errorCode":null,"errorMessage":"unknown item descriptor type {descriptor_type}","messagePattern":"unknown item descriptor type (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/pumpkin-protocol/src/bedrock/server/item_stack_request.rs","lineNumber":265,"sourceCode":"\nfn skip_autocraft_ingredient<R: Read>(reader: &mut R) -> Result<(), Error> {\n    let descriptor_type = VarUInt::read(reader)?.0;\n    let _legacy_type = u8::read(reader)?;\n    match descriptor_type {\n        0 => {}\n        1 => {\n            let _identifier = String::read(reader)?;\n            let _aux = VarInt::read(reader)?;\n        }\n        2 => {\n            let _expression = String::read(reader)?;\n            let _version = i16::read(reader)?;\n        }\n        3 => {\n            let _tag = String::read(reader)?;\n        }\n        _ => {\n            return Err(Error::new(\n                ErrorKind::InvalidData,\n                format!(\"unknown item descriptor type {descriptor_type}\"),\n            ));\n        }\n    }\n    let _count = u16::read(reader)?;\n    Ok(())\n}\n\n#[derive(Debug)]\npub struct ItemStackRequest {\n    pub request_id: VarInt,\n    pub actions: Vec<ItemStackRequestAction>,\n    pub filter_strings: Vec<String>,\n    pub filter_cause: i32,\n}\n\nimpl PacketRead for ItemStackRequest {","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin-protocol/src/bedrock/server/item_stack_request.rs#L247-L283","documentation":"Thrown when decoding an item descriptor whose descriptor_type is outside the supported set (0..=3: invalid, item, item-with-block, destructive-tag descriptor). Unknown values mean the stream does not conform to any known descriptor encoding. The decoder returns an InvalidData error and drops the packet.","triggerScenarios":"A client sends an ItemStackRequest/creative-content style descriptor with descriptor_type >= 4; caused by protocol mismatch, malformed data, or a fuzzed packet.","commonSituations":"Bedrock version skew after a game update adding new descriptor kinds; custom clients; replaying old captures against a newer decoder.","solutions":["Match client and server protocol versions","If a newer protocol defines additional descriptor types, extend the match in item_stack_request.rs","Inspect the raw bytes at the descriptor offset to confirm the type value actually read"],"exampleFix":"// before\nlet descriptor_type: VarUInt = VarUInt(7);\n// after\nlet descriptor_type: VarUInt = VarUInt(1); // supported: 0..=3","handlingStrategy":"validation","validationCode":"fn supported_descriptor(t: u32) -> bool { t <= 3 }","typeGuard":"fn to_descriptor_kind(t: u32) -> Option<DescriptorKind> { DescriptorKind::from_u32(t) }","tryCatchPattern":"if let Err(e) = decode(reader) {\n    if e.to_string().contains(\"unknown item descriptor type\") { skip_packet(peer); return Ok(()); }\n    return Err(e.into());\n}","preventionTips":["Regenerate/verify descriptor decoding tables after each Bedrock protocol bump","Fuzz descriptor_type bytes against the decoder","Check the version byte preceding the descriptor to route per-version decoders"],"tags":["protocol","bedrock","deserialization","invalid-enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}