Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2022-31159

HIGH 7.9EPSS 67%

Partial Path Traversal in com.amazonaws:aws-java-sdk-s3

Also known as GHSA-c28r-hw5m-5gv3

Mitigation

  • Upgrade com.amazonaws:aws-java-sdk-s3 to 1.12.261 or later.

Who should check

  • Projects that depend on Maven package com.amazonaws:aws-java-sdk-s3 (< 1.12.261)
  • Anyone running aws-sdk-java <= 1.12.260

Vulnerability facts

Affected
com.amazonaws:aws-java-sdk-s3 < 1.12.261
Fixed in
1.12.261
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, login needed
CVSS
7.9 (v3.1, CNA)CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:LOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: High
  • Privileges required: Low
  • User interaction: Required
  • Scope: Changed (impact reaches other components)
  • Confidentiality impact: High
  • Integrity impact: High
  • Availability impact: Low
EPSS
1.18% chance of exploitation in 30 days (percentile 67, 2026-11-26)
CWE
CWE-22
Published
Modified

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 `..` .

Affected and fixed versions

Package / productAffectedFixedSource
Maven com.amazonaws:aws-java-sdk-s3< 1.12.2611.12.261osv
aws-sdk-java<= 1.12.260—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2022-31159. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-31159.md
Affected: com.amazonaws:aws-java-sdk-s3 < 1.12.261
Fixed in: 1.12.261

Steps:
1. Search this machine and project for com.amazonaws:aws-java-sdk-s3 (Maven), aws-sdk-java: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2022-31159 being exploited?

There is no confirmed exploitation: CVE-2022-31159 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.18% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2022-31159?

High: CVSS 7.9 (v3.1, scored by CNA). Remote, login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

Which versions are affected by CVE-2022-31159?

com.amazonaws:aws-java-sdk-s3 < 1.12.261.

Is there a fix for CVE-2022-31159?

Yes. Fixed in 1.12.261. Upgrade com.amazonaws:aws-java-sdk-s3 to 1.12.261 or later.

How do I check if I'm affected by CVE-2022-31159?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors