# CVE-2022-2582: Exposure of unencrypted plaintext hash in github.com/aws/aws-sdk-go

> The AWS S3 Crypto SDK exposes an unencrypted plaintext hash, allowing attackers to brute force the original data if the metadata is accessible.

- **Severity:** Medium 4.3 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Dec 2022
- **Updated:** 11 Apr 2025
- **Also known as:** DEBIAN-CVE-2022-2582, GHSA-6jvc-q2x7-pchv, GHSA-76wf-9vgp-pj7w, GO-2022-0391, UBUNTU-CVE-2022-2582

## What is CVE-2022-2582?

CVE-2022-2582 is a medium-severity vulnerability in github.com/aws/aws-sdk-go/service/s3/s3crypto, published on 27 Dec 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

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.

Weakness: CWE-326 (Inadequate Encryption Strength)

## Which versions are affected by CVE-2022-2582?

5 open source packages ship an affected version, including github.com/aws/aws-sdk-go. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/aws/aws-sdk-go` | Go | All versions | 1.34.0 |
| `github.com/aws/aws-sdk-go` | Go | All versions | 1.34.0 |
| `github.com/aws/aws-sdk-go` | Go | All versions | 1.34.0 |
| `github.com/aws/aws-sdk-go` | Go | All versions | 1.34.0 |
| `github.com/aws/aws-sdk-go` | Go | All versions | 1.34.0 |

Products: Amazon Aws Software Development Kit.

## How do I fix CVE-2022-2582?

Upgrade github.com/aws/aws-sdk-go to 1.34.0 or later.

## Is CVE-2022-2582 being exploited?

There is no known exploitation of CVE-2022-2582 in the wild and no public exploit code.

## Other vulnerabilities in github.com/aws/aws-sdk-go/service/s3/s3crypto

- [CVE-2018-19981](https://insights.sbomify.com/CVE-2018-19981/): Information disclosure in n/a (high 7.2)
- [CVE-2026-19642](https://insights.sbomify.com/CVE-2026-19642/): Out-of-bounds write in the Base64 decoder in Amazon aws-sdk-cpp (medium 6.0)
- [CVE-2026-19643](https://insights.sbomify.com/CVE-2026-19643/): Out-of-bounds read in the Base64 decoder in Amazon aws-sdk-cpp on signed-char platforms (medium 6.0)
- [CVE-2023-51651](https://insights.sbomify.com/CVE-2023-51651/): Potential URI resolution path traversal in the AWS SDK for PHP (medium 6.0)
- [CVE-2022-4725](https://insights.sbomify.com/CVE-2022-4725/): AWS SDK XML Parser XpathUtils.java XpathUtils server-side request forgery (medium 5.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-2582 and fix it if it is affected.

What it is: CVE-2022-2582 is a medium-severity vulnerability in github.com/aws/aws-sdk-go/service/s3/s3crypto, published on 27 Dec 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-2582 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/aws/aws-sdk-go (Go): affected all versions; fixed in 1.34.0
- github.com/aws/aws-sdk-go (Go): affected all versions; fixed in 1.34.0
- github.com/aws/aws-sdk-go (Go): affected all versions; fixed in 1.34.0
- github.com/aws/aws-sdk-go (Go): affected all versions; fixed in 1.34.0
- github.com/aws/aws-sdk-go (Go): affected all versions; fixed in 1.34.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-2582/ (Markdown: https://insights.sbomify.com/CVE-2022-2582/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-2582
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-2582
- OSV: https://osv.dev/vulnerability/CVE-2022-2582

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-2582/
Summaries are generated and may contain mistakes; the official description above is the record.
