{"record":{"id":"2fa974a38d0039bc","repo":"shadow1ng/fscan","slug":"unknown-data-pdu-type2-0x-02x","errorCode":null,"errorMessage":"Unknown data pdu type2 0x%02x","messagePattern":"Unknown data pdu type2 0x%02x","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libs/grdp/protocol/pdu/data.go","lineNumber":480,"sourceCode":"\n\tcase PDUTYPE2_CONTROL:\n\t\td = &ControlDataPDU{}\n\n\tcase PDUTYPE2_FONTLIST:\n\t\td = &FontListDataPDU{}\n\n\tcase PDUTYPE2_SET_ERROR_INFO_PDU:\n\t\td = &ErrorInfoDataPDU{}\n\n\tcase PDUTYPE2_FONTMAP:\n\t\td = &FontMapDataPDU{}\n\n\tcase PDUTYPE2_SAVE_SESSION_INFO:\n\t\tglog.Debug(\"SAVE_SESSION_INFO event triggered, login successful\")\n\t\td = &SaveSessionInfo{}\n\n\tdefault:\n\t\terr = errors.New(fmt.Sprintf(\"Unknown data pdu type2 0x%02x\", header.PDUType2))\n\t\tglog.Error(err)\n\t\treturn nil, err\n\t}\n\n\terr = d.Unpack(r)\n\tif err != nil {\n\t\tglog.Error(\"Read data pdu:\", err)\n\t\treturn nil, err\n\t}\n\n\tp := &DataPDU{\n\t\tHeader: header,\n\t\tData:   d,\n\t}\n\treturn p, nil\n}\n\ntype DataPDUData interface {","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/libs/grdp/protocol/pdu/data.go#L462-L498","documentation":"readDataPDU in libs/grdp/protocol/pdu/data.go dispatches on the share-data header's pduType2 field. When the received slow-path data PDU type2 is not one the library implements (e.g. an unhandled control/server-directory/notification type), it returns this error. It means the server sent a share control/data PDU type this client cannot decode.","triggerScenarios":"During an RDP session, the server sends a slow-path Data PDU whose pduType2 byte is outside the supported set (PDUTYPE2_UPDATE, PDUTYPE2_CONTROL, PDUTYPE2_POINTER, PDUTYPE2_INPUT, PDUTYPE2_SYNCHRONIZE, PDUTYPE2_SAVE_SESSION_INFO, etc.), typically inside readDataPDU invoked by the session read loop.","commonSituations":"Windows servers emitting optional PDUs (e.g. PDUTYPE2_STATUS_WINDOW_TRACKING, PDUTYPE2_SHUTDOWN_DENIED) the Go client never implemented; stream desynchronization after a previous malformed PDU; connecting to terminal servers with session-redirection or RAIL features enabled.","solutions":["Identify the 0x%02x value and add a case/struct for that PDUTYPE2 in data.go, or change the default branch to skip/ignore unknown data PDUs and continue the session loop","Disable server features that trigger the exotic PDU (disable session info advertisement, RAIL, status tracking) in the client's capability/negotiation data","Confirm the stream is aligned — a misparsed earlier PDU shifts bytes so a random byte lands in pduType2; test against a reference client (mstsc) to the same server","Update grdp to a version with broader PDUTYPE2 coverage"],"exampleFix":"// before (data.go readDataPDU)\ndefault:\n\terr = errors.New(fmt.Sprintf(\"Unknown data pdu type2 0x%02x\", header.PDUType2))\n\tglog.Error(err)\n\treturn nil, err\n// after: tolerate unknown types\ndefault:\n\tglog.Warn(\"ignoring unknown data pdu type2 0x%02x\", header.PDUType2)\n\treturn nil, nil","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"pdu, err := session.ReadDataPDU()\nif err != nil {\n    if strings.Contains(err.Error(), \"Unknown data pdu type2\") {\n        log.Printf(\"skipping unsupported PDU: %v\", err)\n        return nil // tolerate and continue session\n    }\n    return err\n}","preventionTips":["Disable unneeded server features (RAIL, session redirection, status tracking) in negotiation","Patch readDataPDU to ignore unrecognized type2 values instead of terminating the session","Validate stream alignment when multiple parse errors occur in sequence","Track MS-RDPBCGR PDUTYPE2 values your server infrastructure emits"],"tags":["rdp","protocol-parsing","pdu"],"backgroundTag":"unsupported-enum-value","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}