{"record":{"id":"5464e7b4e2159063","repo":"peass-ng/PEASS-ng","slug":"unknown-ber-object-encountered","errorCode":null,"errorMessage":"unknown BER object encountered","messagePattern":"unknown BER object encountered","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/asn1/Asn1InputStream.cs","lineNumber":216,"sourceCode":"\n                if ((tag & Asn1Tags.Tagged) != 0)\n                {\n                    return new BerTaggedObjectParser(true, tagNo, sp).ToAsn1Object();\n                }\n\n                // TODO There are other tags that may be constructed (e.g. BitString)\n                switch (tagNo)\n                {\n                    case Asn1Tags.OctetString:\n                        return new BerOctetStringParser(sp).ToAsn1Object();\n                    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; }","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/asn1/Asn1InputStream.cs#L198-L234","documentation":"A BER/DER decoding guard in Asn1InputStream.ReadObject: while parsing indefinite-length (constructed) ASN.1, the tag number was not one of the recognized constructed types (OctetString, Sequence, Set, External, tagged) so the parser cannot build an object for it. It fires on malformed or non-standard ASN.1 input, and also serves as the catch-all for unrecognized tags in corrupted streams.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/asn1/Asn1InputStream.cs:216 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the input bytes are valid DER/BER encoded data before parsing","Re-encode the original object with BouncyCastle's Asn1Encodable DER/BER writers instead of hand-crafted encodings","If the payload may be truncated, read the complete stream into a buffer before constructing Asn1InputStream"],"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"}