{"record":{"id":"00f285f39218bb32","repo":"shadow1ng/fscan","slug":"unhandle-server-gcc-block-v","errorCode":null,"errorMessage":"unhandle server gcc block %v","messagePattern":"unhandle server gcc block (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"libs/grdp/protocol/t125/mcs.go","lineNumber":331,"sourceCode":"\tif err != nil {\n\t\tc.Emit(\"error\", errors.New(fmt.Sprintf(\"ReadConnectResponse %v\", err)))\n\t\treturn\n\t}\n\t// record server gcc block\n\tserverSettings := gcc.ReadConferenceCreateResponse(cResp.userData)\n\tfor _, v := range serverSettings {\n\t\tswitch v.(type) {\n\t\tcase *gcc.ServerSecurityData:\n\t\t\tc.serverSecurityData = v.(*gcc.ServerSecurityData)\n\n\t\tcase *gcc.ServerCoreData:\n\t\t\tc.serverCoreData = v.(*gcc.ServerCoreData)\n\n\t\tcase *gcc.ServerNetworkData:\n\t\t\tc.serverNetworkData = v.(*gcc.ServerNetworkData)\n\n\t\tdefault:\n\t\t\terr := errors.New(fmt.Sprintf(\"unhandle server gcc block %v\", reflect.TypeOf(v)))\n\t\t\tglog.Error(err)\n\t\t\tc.Emit(\"error\", err)\n\t\t\treturn\n\t\t}\n\t}\n\tglog.Debugf(\"serverSecurityData: %+v\", c.serverSecurityData)\n\tglog.Debugf(\"serverCoreData: %+v\", c.serverCoreData)\n\tglog.Info(\"version\", c.serverCoreData.RdpVersion, c.serverCoreData.ClientRequestedProtocol)\n\tglog.Debugf(\"serverNetworkData: %+v\", c.serverNetworkData)\n\tglog.Debug(\"mcs sendErectDomainRequest\")\n\tc.sendErectDomainRequest()\n\n\tglog.Debug(\"mcs sendAttachUserRequest\")\n\tc.sendAttachUserRequest()\n\n\tc.transport.Once(\"data\", c.recvAttachUserConfirm)\n}\n","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/shadow1ng/fscan/blob/95cc12e753bf43de7004e5aef42a9ffba3934303/libs/grdp/protocol/t125/mcs.go#L313-L349","documentation":"After decoding the MCS Connect Response, recvConnectResponse parses the embedded GCC blocks from userData. The library only handles ServerSecurityData, ServerCoreData and ServerNetworkData; any other GCC block type hits the default branch and emits this error with the block's reflect.TypeOf name. It means the server sent GCC server settings this client cannot process.","triggerScenarios":"gcc.ReadConferenceCreateResponse returns a settings list containing a block whose concrete type is none of *gcc.ServerSecurityData, *gcc.ServerCoreData, *gcc.ServerNetworkData — e.g. a ServerMessageChannelData or Monitor Data block — during recvConnectResponse.","commonSituations":"Connecting to servers that include additional GCC blocks (xrdp, virtualization hosts, RDP brokers with load-balance/monitor data); a newer server OS adding settings this fork of grdp does not implement; a mis-parsed userData stream producing a bogus block type.","solutions":["Note the type name printed in the error and add a case for that GCC block type in recvConnectResponse (parse or skip it).","For unknown-but-harmless blocks, change the default branch to log a warning and continue instead of returning an error.","Compare with FreeRDP behavior for the same server to see which GCC blocks are standard for that target.","Check gcc.ReadConferenceCreateResponse parsing — a misaligned stream can fabricate spurious block types."],"exampleFix":"// before\ndefault:\n    err := errors.New(fmt.Sprintf(\"unhandle server gcc block %v\", reflect.TypeOf(v)))\n    glog.Error(err)\n    c.Emit(\"error\", err)\n    return\n// after\ndefault:\n    glog.Warn(\"ignoring server gcc block\", reflect.TypeOf(v)) // skip unknown blocks instead of failing","handlingStrategy":"fallback","validationCode":"// Inspect which GCC block types a server sends before connecting:\nfor _, v := range gcc.ReadConferenceCreateResponse(userData) {\n    glog.Debug(\"gcc block:\", reflect.TypeOf(v))\n}","typeGuard":null,"tryCatchPattern":"mcs.On(\"error\", func(err error) {\n    if strings.Contains(err.Error(), \"unhandle server gcc block\") {\n        // proceed with defaults or patch grdp to skip the unknown block\n    }\n})","preventionTips":["Patch the default branch to warn-and-continue for unknown GCC blocks.","Test against your exact server platform (xrdp, brokers, VDI) to inventory its GCC blocks.","Keep gcc parsing in sync with FreeRDP's server settings list."],"tags":["rdp","gcc","protocol-parsing","unhandled-type"],"backgroundTag":"unexpected-response-shape","analyzedSha":"95cc12e753bf43de7004e5aef42a9ffba3934303","analyzedAt":"2026-09-06T17:07:30.094Z","contentChangedAt":"2026-09-06T17:07:30.094Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}