amazon aws-sdk-java CVE-2022-31159 is a vulnerability in Amazon Aws Sdk Java
Published on July 15, 2022

Partial Path Traversal in com.amazonaws:aws-java-sdk-s3
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 issues 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 `..` .

Github Repository NVD

Vulnerability Analysis

CVE-2022-31159 can be exploited with network access, requires user interaction and a small amount of user privileges. This vulnerability is consided to have a high level of attack complexity. Public availability of a proof of concept (POC) exploit exists for CVE-2022-31159. The potential impact of an exploit of this vulnerability is considered to have a high impact on confidentiality and integrity, and a small impact on availability.

Attack Vector:
NETWORK
Attack Complexity:
HIGH
Privileges Required:
LOW
User Interaction:
REQUIRED
Scope:
CHANGED
Confidentiality Impact:
HIGH
Integrity Impact:
HIGH
Availability Impact:
LOW

Weakness Type

What is a Directory traversal Vulnerability?

The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

CVE-2022-31159 has been classified to as a Directory traversal vulnerability or weakness.


Products Associated with CVE-2022-31159

Want to know whenever a new CVE is published for Amazon Aws Sdk Java? stack.watch will email you.

 

Affected Versions

aws-sdk-java Version <= 1.12.260 is affected by CVE-2022-31159

Vulnerable Packages

The following package name and versions may be associated with CVE-2022-31159

Package Manager Vulnerable Package Versions Fixed In
maven ca.uhn.hapi.fhir:org.hl7.fhir.core < 5.6.106 5.6.106
maven ca.uhn.hapi.fhir:org.hl7.fhir.convertors < 5.6.106 5.6.106
maven ca.uhn.hapi.fhir:org.hl7.fhir.r4b < 5.6.106 5.6.106
maven ca.uhn.hapi.fhir:org.hl7.fhir.r5 < 5.6.106 5.6.106
maven ca.uhn.hapi.fhir:org.hl7.fhir.utilities < 5.6.106 5.6.106
maven ca.uhn.hapi.fhir:org.hl7.fhir.validation < 5.6.106 5.6.106

Exploit Probability

EPSS
0.05%
Percentile
16.42%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.