{"id":"CVE-2022-2582","aliases":["CVE-2022-2582","GHSA-6jvc-q2x7-pchv","GHSA-76wf-9vgp-pj7w","GO-2022-0391"],"related":["CGA-4c73-hw8q-28pg"],"kind":"vulnerability","state":"published","title":"Exposure of unencrypted plaintext hash in github.com/aws/aws-sdk-go","summary":"The AWS S3 Crypto SDK sends an unencrypted hash of the plaintext alongside the ciphertext as a metadata field. This hash can be used to brute force the plaintext, if the hash is readable to the attacker. AWS now blocks this metadata field, but older SDK versions still send it.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The AWS S3 Crypto SDK sends an unencrypted hash of the plaintext alongside the ciphertext as a metadata field. This hash can be used to brute force the plaintext, if the hash is readable to the attacker. AWS now blocks this metadata field, but older SDK versions still send it.","source":"cvelist"},{"lang":"en","text":"## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-6jvc-q2x7-pchv. This link is maintained to preserve external references.\n\n## Original Description\n### Summary\n\nThe golang AWS S3 Crypto SDK was impacted by an issue that can result in loss of confidentiality. An attacker with read access to an encrypted S3 bucket was able to recover the plaintext without accessing the encryption key.\n\n### Specific Go Packages Affected\ngithub.com/aws/aws-sdk-go/service/s3/s3crypto\n\n### Risk/Severity\n\nThe vulnerability poses insider risks/privilege escalation risks, circumventing KMS controls for stored data.\n\n### Impact\n\nThe issue has been fully mitigated by AWS as of Aug. 5th by disallowing the header in question.\n\nThe S3 crypto library tries to store an unencrypted hash of the plaintext alongside the ciphertext as a metadata field. This hash can be used to brute force the plaintext in an offline attack, if the hash is readable to the attacker. In order to be impacted by this issue, the attacker has to be able to guess the plaintext as a whole. The attack is theoretically valid if the plaintext entropy is below the key size, i.e. if it is easier to brute force the plaintext instead of the key itself, but practically feasible only for short plaintexts or plaintexts otherwise accessible to the attacker in order to create a rainbow table.\n\nThe issue has been fixed server-side by AWS as of Aug 5th, by blocking the related metadata field. No S3 objects are affected anymore.\n\n### Mitigation\n\nThe header in question is no longer served by AWS, making this attack fully mitigated as of Aug. 5th.\n\n### Proof of concept\n\nA [Proof of concept](https://github.com/sophieschmieg/exploits/tree/master/aws_s3_crypto_poc) is available in a separate github repository, this particular issue can be found at [here](https://github.com/sophieschmieg/exploits/blob/master/aws_s3_crypto_poc/exploit/hash_exploit.go):\n\n```golang\nfunc HashExploit(bucket string, key string, input *OfflineAttackInput) (string, error) {\n\t_, header, err := input.S3Mock.GetObjectDirect(bucket, key)\n\tlength, err := strconv.Atoi(header.Get(\"X-Amz-Meta-X-Amz-Unencrypted-Content-Length\"))\n\tplaintextMd5 := header.Get(\"X-Amz-Meta-X-Amz-Unencrypted-Content-Md5\")\n\tblocks := length / 16\n\tpossiblePlaintextNum := 1\n\tsegNum := len(input.PossiblePlaintextSegments)\n\tfor i := 0; i < blocks; i++ {\n\t\tpossiblePlaintextNum *= segNum\n\t}\n\tfor i := 0; i < possiblePlaintextNum; i++ {\n\t\tw := i\n\t\tguess := \"\"\n\t\tfor j := 0; j < blocks; j++ {\n\t\t\tguess += input.PossiblePlaintextSegments[w%segNum]\n\t\t\tw /= segNum\n\t\t}\n\t\tguessMd5 := md5.Sum([]byte(guess))\n\t\tif plaintextMd5 == base64.StdEncoding.EncodeToString(guessMd5[:]) {\n\t\t\treturn guess, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"No plaintext found!\")\n}\n```\n\nThe PoC will only work on old versions of the library, as the hash has been removed from being calculated as well.","format":"markdown","source":"ghsa"},{"lang":"es","text":"AWS S3 Crypto SDK envía un hash no cifrado del texto plano junto con el texto cifrado como un campo de metadatos. Este hash se puede utilizar para forzar el texto plano, si el hash es legible para el atacante. AWS ahora bloquea este campo de metadatos, pero las versiones anteriores del SDK aún lo envían.","source":"nvd"}],"published":"2022-02-11T23:26:12.000Z","modified":"2026-09-10T03:49:56.186Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-326"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.34.0","status":"affected"}],"vendor":"github.com/aws/aws-sdk-go","product":"github.com/aws/aws-sdk-go/service/s3/s3crypto","package":"github.com/aws/aws-sdk-go/service/s3/s3crypto","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.34.0"}],"ecosystem":"Go","package":"github.com/aws/aws-sdk-go","purl":"pkg:golang/github.com/aws/aws-sdk-go","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.34.0"}],"ecosystem":"Go","package":"github.com/aws/aws-sdk-go","purl":"pkg:golang/github.com/aws/aws-sdk-go","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.34.0"}],"ecosystem":"Go","package":"github.com/aws/aws-sdk-go","purl":"pkg:golang/github.com/aws/aws-sdk-go","source":"go"},{"ranges":[{"status":"affected","fixed":"1.34.0"}],"vendor":"amazon","product":"aws_software_development_kit","cpe":"cpe:2.3:a:amazon:aws_software_development_kit:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/aws/aws-sdk-go/commit/35fa6ddf45c061e0f08d3a3b5119f8f4da38f6d1","tags":["fix","patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://pkg.go.dev/vuln/GO-2022-0391","tags":["exploit","patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/google/security-research/security/advisories/GHSA-76wf-9vgp-pj7w","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-2582","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/aws/aws-sdk-go","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"Go","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-04-11T16:19:30.823Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-2582","url":"https://www.cve.org/CVERecord?id=CVE-2022-2582","licence":"CVE Terms of Use","modified":"2025-04-11T16:20:04.368Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6jvc-q2x7-pchv","url":"https://github.com/advisories/GHSA-6jvc-q2x7-pchv","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:56.186Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-76wf-9vgp-pj7w","url":"https://github.com/advisories/GHSA-76wf-9vgp-pj7w","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:11.693Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2022-0391","url":"https://pkg.go.dev/vuln/GO-2022-0391","licence":"CC-BY-4.0","modified":"2026-02-04T03:52:10.915Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-2582","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-2582","licence":"Public domain","modified":"2026-06-17T04:42:09.430Z"}],"updatedAt":"2026-11-25T22:58:17.902Z","epss":{"score":0.00543,"percentile":0.4705,"date":"2026-12-02T12:00:21.000Z"}}