Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes CVE-2023-51651 Potential URI resolution path traversal in the AWS SDK for PHP #14087

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

joelpittet
Copy link
Contributor

Description

+-------------------+----------------------------------------------------------------------------------+
| Package           | aws/aws-sdk-php                                                                  |
| CVE               | CVE-2023-51651                                                                   |
| Title             | Potential URI resolution path traversal in the AWS SDK for PHP                   |
| URL               | https://github.com/advisories/GHSA-557v-xcg6-rm5m                                |
| Affected versions | <3.288.1                                                                         |
| Reported at       | 2023-12-21T23:16:13+00:00                                                        |
+-------------------+----------------------------------------------------------------------------------+

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Composer audit before and after fix

@joelpittet joelpittet requested a review from snipe as a code owner January 3, 2024 01:25
@probot-autolabeler probot-autolabeler bot added backend dependencies Pull requests that update a dependency file labels Jan 3, 2024
@joelpittet joelpittet marked this pull request as draft January 3, 2024 01:28
@joelpittet
Copy link
Contributor Author

This didn't fix it because

❯ composer update "aws/aws-sdk-php:3.288.1" --dry-run
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - aws/aws-sdk-php 3.288.1 requires aws/aws-crt-php ^1.2.3 -> found aws/aws-crt-php[v1.2.3, v1.2.4] but the package is fixed to v1.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - league/flysystem-aws-s3-v3 1.0.30 requires aws/aws-sdk-php ^3.20.0 -> satisfiable by aws/aws-sdk-php[3.288.1].
    - league/flysystem-aws-s3-v3 is locked to version 1.0.30 and an update of this package was not requested.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

@joelpittet
Copy link
Contributor Author

Added dependencies and ran with PHP 7.4 to preserve that platform requirement

@joelpittet joelpittet marked this pull request as ready for review January 3, 2024 01:32
@joelpittet
Copy link
Contributor Author

FTR here is what is getting updated:

❯ ddev composer update "aws/aws-sdk-php" -W
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 10 updates, 0 removals
  - Upgrading aws/aws-crt-php (v1.0.2 => v1.2.4)
  - Upgrading aws/aws-sdk-php (3.258.2 => 3.295.4)
  - Upgrading guzzlehttp/guzzle (7.4.5 => 7.8.1)
  - Upgrading guzzlehttp/promises (1.5.1 => 2.0.2)
  - Upgrading guzzlehttp/psr7 (2.4.5 => 2.6.2)
  - Upgrading mtdowling/jmespath.php (2.6.1 => 2.7.0)
  - Upgrading psr/http-client (1.0.1 => 1.0.3)
  - Upgrading psr/http-factory (1.0.1 => 1.0.2)
  - Upgrading psr/http-message (1.0.1 => 1.1)
  - Upgrading symfony/polyfill-mbstring (v1.26.0 => v1.28.0)

@snipe snipe requested a review from uberbrady January 3, 2024 23:13
Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution to help keep us secure! It's very much appreciated.

I tested it by doing this - first, I read up on the AWS SDK for PHP, and its minimum PHP versions - which are very conservative (which I like). Then, I tested by switching my system version of PHP to each of 7.4.x, 8.0.x, and 8.1.x and blowing out ./vendors and running composer install - and ensuring that php artisan test works.

I should note that php 8.2.x does not work (dependencies will not install), but I am hoping that we will be able to enable that - and maybe even 8.3 - once we can release Snipe-IT v7.

Thanks again!

@snipe snipe merged commit 824c3e6 into snipe:develop Jan 9, 2024
7 checks passed
@snipe
Copy link
Owner

snipe commented Jan 9, 2024

TY @joelpittet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants