UBUNTU-CVE-2026-40176

Source
https://ubuntu.com/security/CVE-2026-40176
Import Source
https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40176.json
JSON Data
https://api.osv.dev/v1/vulns/UBUNTU-CVE-2026-40176
Upstream
  • CVE-2026-40176
Published
2026-04-15T21:17:00Z
Modified
2026-05-20T16:25:38.478725582Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H CVSS Calculator
  • Ubuntu - medium
Summary
[none]
Details

Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection vulnerability in the Perforce::generateP4Command() method, which constructs shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping. An attacker can inject arbitrary commands through these values in a malicious composer.json declaring a Perforce VCS repository, leading to command execution in the context of the user running Composer, even if Perforce is not installed. VCS repositories are only loaded from the root composer.json or the composer config directory, so this cannot be exploited through composer.json files of packages installed as dependencies. Users are at risk if they run Composer commands on untrusted projects with attacker-supplied composer.json files. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline).

References

Affected packages

Ubuntu:25.10
composer

Package

Name
composer
Purl
pkg:deb/ubuntu/composer?arch=source&distro=questing

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

2.*
2.8.6-1
2.8.8-1

Ecosystem specific

{
    "binaries": [
        {
            "binary_name": "composer",
            "binary_version": "2.8.8-1"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40176.json"
Ubuntu:26.04:LTS
composer

Package

Name
composer
Purl
pkg:deb/ubuntu/composer?arch=source&distro=resolute

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

2.*
2.8.8-1
2.9.5-1

Ecosystem specific

{
    "binaries": [
        {
            "binary_name": "composer",
            "binary_version": "2.9.5-1"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40176.json"
Ubuntu:Pro:16.04:LTS
composer

Package

Name
composer
Purl
pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Fxenial

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

1.*
1.0.0~alpha10+20150602-1
1.0.0~alpha10+20150602-2
1.0.0~alpha11-1
1.0.0~alpha11-1ubuntu1
1.0.0~alpha11-2
1.0.0~alpha11-3
1.0.0~beta1-1ubuntu1
1.0.0~beta2-1
1.0.0~beta2-1ubuntu0.1~esm1
1.0.0~beta2-1ubuntu0.1~esm2

Ecosystem specific

{
    "binaries": [
        {
            "binary_name": "composer",
            "binary_version": "1.0.0~beta2-1ubuntu0.1~esm2"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40176.json"
Ubuntu:Pro:18.04:LTS
composer

Package

Name
composer
Purl
pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Fbionic

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

1.*
1.5.1-1
1.5.2-1
1.6.2-1
1.6.3-1
1.6.3-1ubuntu0.1~esm1
1.6.3-1ubuntu0.1~esm2

Ecosystem specific

{
    "binaries": [
        {
            "binary_name": "composer",
            "binary_version": "1.6.3-1ubuntu0.1~esm2"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40176.json"
Ubuntu:Pro:20.04:LTS
composer

Package

Name
composer
Purl
pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Ffocal

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

1.*
1.9.0-2
1.9.1-1
1.9.2-1
1.9.3-1
1.10.0-1
1.10.1-1
1.10.1-1ubuntu0.1~esm1
1.10.1-1ubuntu0.1~esm2

Ecosystem specific

{
    "binaries": [
        {
            "binary_name": "composer",
            "binary_version": "1.10.1-1ubuntu0.1~esm2"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40176.json"
Ubuntu:Pro:22.04:LTS
composer

Package

Name
composer
Purl
pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Fjammy

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

2.*
2.0.9-2ubuntu2
2.0.9-2ubuntu3
2.0.13-1ubuntu1
2.1.12-1ubuntu1
2.2.6-2ubuntu4
2.2.6-2ubuntu4+esm1

Ecosystem specific

{
    "binaries": [
        {
            "binary_name": "composer",
            "binary_version": "2.2.6-2ubuntu4+esm1"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40176.json"
Ubuntu:Pro:24.04:LTS
composer

Package

Name
composer
Purl
pkg:deb/ubuntu/composer?arch=source&distro=esm-apps%2Fnoble

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected

Affected versions

2.*
2.5.8-1
2.6.5-1
2.6.6-1
2.7.1-2
2.7.1-2ubuntu0.1~esm1

Ecosystem specific

{
    "binaries": [
        {
            "binary_name": "composer",
            "binary_version": "2.7.1-2ubuntu0.1~esm1"
        }
    ]
}

Database specific

source
"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40176.json"