{"record":{"id":"e483f8e00cf9863a","repo":"portainer/portainer","slug":"malformed-ciphertext","errorCode":null,"errorMessage":"malformed ciphertext","messagePattern":"malformed ciphertext","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/libcrypto/decrypt.go","lineNumber":40,"sourceCode":"\t\t// sha256 hash 32 bytes\n\t\thashKey = HashFromBytes(key)\n\t} else {\n\t\t// 16 byte hash, hex encoded is 32 bytes\n\t\thashKey = InsecureHash32Bytes(key)\n\t}\n\n\tblock, err := aes.NewCipher(hashKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgcm, err := cipher.NewGCMWithRandomNonce(block)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(data) < gcm.NonceSize() {\n\t\treturn nil, errors.New(\"malformed ciphertext\")\n\t}\n\n\treturn gcm.Open(nil,\n\t\tnil,\n\t\tdata,\n\t\tnil,\n\t)\n}\n","sourceCodeStart":22,"sourceCodeEnd":49,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/pkg/libcrypto/decrypt.go#L22-L49","documentation":"Error \"malformed ciphertext\" thrown in portainer/portainer.","triggerScenarios":"Thrown at pkg/libcrypto/decrypt.go:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}