{"id":"CVE-2022-31159","published":"2022-07-15T17:45:12Z","modified":"2025-04-22T17:49:09Z","title":"Partial Path Traversal in com.amazonaws:aws-java-sdk-s3","vendor":"aws","product":"aws-sdk-java","tier":"tail","description":{"text":"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 `..` .","provenance":"source","from":"CVE.org"},"cvss":{"score":7.9,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01175,"percentile":0.67397,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://github.com/aws/aws-sdk-java/security/advisories/GHSA-c28r-hw5m-5gv3","tags":["x_refsource_CONFIRM"]}],"priority":{"score":19.0,"factors":[{"name":"EPSS percentile","points":13.48},{"name":"CVSS severity","points":5.53}]},"vendorSlug":"aws","affectedVersions":[{"vendor":"aws","product":"aws-sdk-java","versions":["<= 1.12.260"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2025-04-22T15:42:41.695908Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Maven","package":"com.amazonaws:aws-java-sdk-s3","vulnerableRanges":["<1.12.261"],"patched":["1.12.261"],"from":["GHSA-c28r-hw5m-5gv3"],"provenance":"source"}],"summary":{"text":"The AWS SDK for Java v1 (aws-java-sdk-s3) prior to version 1.12.261 contains a partial path traversal flaw in the downloadDirectory method of the S3 TransferManager component, where key-name validation can be bypassed with a double-dot sequence in an object key. An attacker who controls the contents of an S3 bucket that an application downloads with TransferManager.downloadDirectory can, with user interaction and a specific configuration, write files outside the intended destination directory, though only to sibling directories whose names share the destination directory's prefix.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:12:43Z"},"euvd":{"id":"EUVD-2022-6311","exploited":false,"provenance":"source"}}