CVE-2022-31159: amazon aws-sdk-java Path Traversal
Vulnerability summary
CVE-2022-31159 is a high (CVSS 7.9) Path Traversal vulnerability in amazon aws-sdk-java. EPSS estimates a 1.62% chance of exploitation in the next 30 days, higher than 75.6% of scored vulnerabilities. 1 public exploit is recorded.
Advisory lineage
Upstream 0 · Downstream 0 · Duplicates 1Timeline
- 15-07-2022PublishedVulnerability first disclosed.
- 22-04-2025Last modifiedVulnerability information updated.
Description
The AWS SDK for Java enables Java developers to work with Amazon Web Services. A partial-path traversal issue exists within the `downloadDirectory` method in the AWS S3 TransferManager component of the AWS SDK for Java v1 prior to version 1.12.261. Applications using the SDK control the `destinationDirectory` argument, but S3 object keys are determined by the application that uploaded the objects. The `downloadDirectory` method allows the caller to pass a filesystem object in the object key but contained an issue in the validation logic for the key name. A knowledgeable actor could bypass the validation logic by including a UNIX double-dot in the bucket key. Under certain conditions, this could permit them to retrieve a directory from their S3 bucket that is one level up in the filesystem from their working directory. This issue’s scope is limited to directories whose name prefix matches the destinationDirectory. E.g. for destination directory`/tmp/foo`, the actor can cause a download to `/tmp/foo-bar`, but not `/tmp/bar`. If `com.amazonaws.services.s3.transfer.TransferManager::downloadDirectory` is used to download an untrusted buckets contents, the contents of that bucket can be written outside of the intended destination directory. Version 1.12.261 contains a patch for this issue. As a workaround, when calling `com.amazonaws.services.s3.transfer.TransferManager::downloadDirectory`, pass a `KeyFilter` that forbids `S3ObjectSummary` objects that `getKey` method return a string containing the substring `..` .
CVSS metrics
4 scores · 4 sources · 1 version- OSV · ChainguardEcosystem advisory · calculated7.9HighCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:L
- OSV · MavenEcosystem advisory · calculated7.9HighCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:L
- NVDNIST6.5MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:NDiffers
EPSS trend
Probability
1.62%
Chance of exploitation in the next 30 days
Percentile
76%
Versus all other CVEs
30-day change
+0.09 pp
From 1.53% on 18-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundAws Sdk Java
Maturity: poc
Weaknesses
CWE · root causeAffected systems
Chainguard100 products
- eco-java-gradle-2.10All versions (No fix recorded)
- eco-java-gradle-2.11All versions (No fix recorded)
- eco-java-gradle-2.12All versions (No fix recorded)
- eco-java-gradle-2.13All versions (No fix recorded)
- eco-java-gradle-2.14All versions (No fix recorded)
Amazon1 product
- aws-sdk-java≤ 1.12.260
Aws1 product
- aws-sdk-java≤ 1.12.260
Com.amazonaws1 product
- aws-java-sdk-s3< 1.12.261
4 vendors · 103 products
References
5 links- github.com/aws/aws-sdk-java/security/advisories/GHSA-c28r-hw5m-5gv3X Refsource CONFIRMAdvisoryWEBExploitThird Party Advisory
- github.com/aws/aws-sdk-javaPACKAGE