{"record":{"id":"a526c00c4d9ce608","repo":"peass-ng/PEASS-ng","slug":"corrupted-stream-detected","errorCode":null,"errorMessage":"corrupted stream detected","messagePattern":"corrupted stream detected","errorType":"exception","errorClass":"Asn1Exception","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/asn1/Asn1InputStream.cs","lineNumber":227,"sourceCode":"                    case Asn1Tags.Sequence:\n                        return new BerSequenceParser(sp).ToAsn1Object();\n                    case Asn1Tags.Set:\n                        return new BerSetParser(sp).ToAsn1Object();\n                    case Asn1Tags.External:\n                        return new DerExternalParser(sp).ToAsn1Object();\n                    default:\n                        throw new IOException(\"unknown BER object encountered\");\n                }\n            }\n            else\n            {\n                try\n                {\n                    return BuildObject(tag, tagNo, length);\n                }\n                catch (ArgumentException e)\n                {\n                    throw new Asn1Exception(\"corrupted stream detected\", e);\n                }\n            }\n        }\n\n        internal virtual int Limit\n        {\n            get { return limit; }\n        }\n\n        internal static int ReadTagNumber(\n            Stream s,\n            int tag)\n        {\n            int tagNo = tag & 0x1f;\n\n            //\n            // with tagged object tag number is bottom 5 bits, or stored at the start of the content\n            //","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/asn1/Asn1InputStream.cs#L209-L245","documentation":"An integrity guard in Asn1InputStream.ReadObject: the definitive-length branch (BuildObject) detected inconsistent length/structure data — the encoded length does not match the actual content — so the stream is treated as corrupted. It fires when the byte input is truncated, damaged, or not ASN.1 at all.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/asn1/Asn1InputStream.cs:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the provenance and integrity (e.g. Base64 decode, transfer encoding) of the data being parsed","Ensure the full payload was read before ASN.1 parsing; buffer the complete stream","Wrap parsing in IOException handling and reject the input as malformed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}