{"record":{"id":"f04edfc424cb6945","repo":"peass-ng/PEASS-ng","slug":"invalid-value-for-mac-size","errorCode":null,"errorMessage":"Invalid value for MAC size: ","messagePattern":"Invalid value for MAC size: ","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/crypto/modes/GcmBlockCipher.cs","lineNumber":106,"sourceCode":"        {\n            this.forEncryption = forEncryption;\n            this.macBlock = null;\n            this.initialised = true;\n\n            KeyParameter keyParam;\n            byte[] newNonce = null;\n\n            if (parameters is AeadParameters)\n            {\n                AeadParameters param = (AeadParameters)parameters;\n\n                newNonce = param.GetNonce();\n                initialAssociatedText = param.GetAssociatedText();\n\n                int macSizeBits = param.MacSize;\n                if (macSizeBits < 32 || macSizeBits > 128 || macSizeBits % 8 != 0)\n                {\n                    throw new ArgumentException(\"Invalid value for MAC size: \" + macSizeBits);\n                }\n\n                macSize = macSizeBits / 8;\n                keyParam = param.Key;\n            }\n            else if (parameters is ParametersWithIV)\n            {\n                ParametersWithIV param = (ParametersWithIV)parameters;\n\n                newNonce = param.GetIV();\n                initialAssociatedText = null;\n                macSize = 16;\n                keyParam = (KeyParameter)param.Parameters;\n            }\n            else\n            {\n                throw new ArgumentException(\"invalid parameters passed to GCM\");\n            }","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/crypto/modes/GcmBlockCipher.cs#L88-L124","documentation":"A parameter validation in GcmBlockCipher.Init: when initialized from AeadParameters, the requested MAC size in bits must be between 32 and 128 inclusive and a multiple of 8 (GCM tags are truncated 128-bit tags). It fires when MacSize is set outside that range or is not byte-aligned; the message prints the offending bit count.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/BouncyCastle/crypto/modes/GcmBlockCipher.cs:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a standard GCM tag size: 128 bits (16 bytes), or 120/112/104/96 bits per NIST SP 800-38D","Construct AeadParameters with a MacSize that is a multiple of 8 within 32..128","Prefer the common 12-byte IV / 16-byte tag defaults unless truncation is intentionally accepted"],"exampleFix":null,"handlingStrategy":"validation","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"}