-1

Background:

Server Environment:

  • Linux
  • Shared web hosting

These are the steps I took:

Step 1: Log on to Terminal and find out the composer version I am using

composer -vvv about

Result:

Running 2.0.6 (2020-11-07 11:21:17) with PHP 7.3.27 on Linux / 4.19.150-76.ELK.el6.x86_64

Step 2: Run command to update Composer

composer self-update

Result: Error Message

Upgrading to version 2.0.13 (stable channel).

[Composer\Downloader\FilesystemException] Filesystem exception: Composer update failed: "/opt/cpanel/composer/bin/composer" could not be written. rename(/opt/cpanel/composer/bin/composer): failed to open stream: Read-only file system

self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--1] [--2] [--set-channel-only] [--] [< version>]

Step 3: Find out the permissions for /opt/cpanel/composer/bin/composer

ls -l /opt/cpanel/composer/bin/composer

Result:

-rwxr-xr-x 1 bin bin 2192976 Nov 10 13:37 /opt/cpanel/composer/bin/composer*

stat /opt/cpanel/composer/bin/composer

Result:

File: `/opt/cpanel/composer/bin/composer'

Size: 2192976 Blocks: 4288 IO Block: 4096 regular file

Device: 801h/2049d Inode: 266192 Links: 1

Access: (0755/-rwxr-xr-x) Uid: ( 1/ bin) Gid: ( 1/ bin)

Access: 2021-05-02 02:40:36.937400521 -0600

Modify: 2020-11-10 13:37:13.000000000 -0700

Change: 2021-04-14 16:25:27.129945713 -0600

1 Answers1

-1

You cannot upgrade composer on a shared hosting environment. You could download an entirely new instance of composer to another folder but you may run into restrictions. You should contact the hosting provider and let them know. Alternatively since you are on cPanel you can contact cPanel.

Additionally you should read the exploit more carefully. Do you have Mercurial? This exploit might not even apply to you.

The second exploit link you listed is not related to you, as you are on a higher version than the exploited one.

Jesse
  • 2,790
  • 1
  • 20
  • 36