CVE-2023-51651: Aws/aws sdk php Path Traversal Vulnerability
MODERATECVE-2023-51651 is a MODERATE (CVSS 6.0) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Aws/aws sdk php libraries in the Packagist ecosystem. The issue involves potential uri resolution path traversal in the aws sdk for php. Remediation is available by upgrading affected packages to version 3.288.1.
CVE-2023-51651 at a Glance
Security Impact
CVSS: 6.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N).
How to Fix CVE-2023-51651
To remediate this vulnerability, upgrade all affected Aws/aws sdk php dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade aws/aws-sdk-php to 3.288.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for aws/aws-sdk-php
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-51651, inspect your project dependencies for Aws/aws sdk php:
inspect dependencies for aws/aws-sdk-php
Analyze the terminal output to locate any version of Aws/aws sdk php in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.288.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product 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 product 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. In Aws/aws sdk php, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-51651 Affected Aws/aws sdk php Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
aws/aws-sdk-php
|
Packagist |
< 3.288.1
|
3.288.1
|
References
Frequently Asked Questions
What is CVE-2023-51651?
Which Aws/aws sdk php versions are affected?
What version fixes CVE-2023-51651?
Is aws/aws-sdk-php affected?
What is the CVSS score of CVE-2023-51651?
What CWE is associated with CVE-2023-51651?
How can I check Packagist dependencies for CVE-2023-51651?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-557v-xcg6-rm5m",
"modified" : "2023-12-22T22:27:19Z",
"published" : "2023-12-21T23:16:13Z",
"aliases" : [ "CVE-2023-51651" ],
"summary" : "Potential URI resolution path traversal in the AWS SDK for PHP",
"details" : "### Impact\nWithin the scope of requests to S3 object keys and/or prefixes containing a Unix double-dot, a URI path traversal is possible. The issue exists in the`buildEndpoint` method in the `RestSerializer` component of the AWS SDK for PHP v3 prior to 3.288.1. The `buildEndpoint` method relies on the Guzzle Psr7 `UriResolver` utility, which strips dot segments from the request path in accordance with RFC 3986. Under certain conditions, this could lead to an arbitrary object being accessed.\n\nVersions of the AWS SDK for PHP v3 before 3.288.1 are affected by this issue.\n\n### Patches\nUpgrade to the AWS SDK for PHP >= 3.288.1, if you are on version < 3.288.1.\n\n### References\nRFC 3986 - [https://datatracker.ietf.org/doc/html/rfc3986](https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4)\n\n### For more information\nIf you have any questions or comments about this advisory, please contact [AWS's Security team](mailto:aws-security@amazon.com).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "aws/aws-sdk-php"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.288.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/aws/aws-sdk-php/security/advisories/GHSA-557v-xcg6-rm5m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-51651"
}, {
"type" : "WEB",
"url" : "https://github.com/aws/aws-sdk-php/commit/aebc9f801438746ac4ade327551576cb75f635f2"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/aws/aws-sdk-php/CVE-2023-51651.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/aws/aws-sdk-php"
}, {
"type" : "WEB",
"url" : "https://github.com/aws/aws-sdk-php/releases/tag/3.288.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-12-21T23:16:13Z",
"nvd_published_at" : "2023-12-22T21:15:09Z"
}
}