UBUNTU-CVE-2026-40261

Source
https://ubuntu.com/security/CVE-2026-40261
Import Source
https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-40261.json
JSON Data
https://api.osv.dev/v1/vulns/UBUNTU-CVE-2026-40261
Upstream
  • CVE-2026-40261
Published
2026-04-15T21:17:00Z
Modified
2026-05-20T16:25:39.246380384Z
Severity
  • 8.8 (High) CVSS_V3 - CVSS:3.1/AV:N/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::syncCodeBase() method, which appends the $sourceReference parameter to a shell command without proper escaping, and additionally in the Perforce::generateP4Command() method as in GHSA-wg36-wvj6-r67p / CVE-2026-40176, which interpolates user-supplied Perforce connection parameters (port, user, client) from the source url field without proper escaping. An attacker can inject arbitrary commands through crafted source reference or source url values containing shell metacharacters, even if Perforce is not installed. Unlike CVE-2026-40176, the source reference and url are provided as part of package metadata, meaning any compromised or malicious Composer repository can serve package metadata declaring perforce as a source type with malicious values. This vulnerability is exploitable when installing or updating dependencies from source, including the default behavior when installing dev-prefixed versions. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline). If developers are unable to immediately update, they can avoid installing dependencies from source by using --prefer-dist or the preferred-install: dist config setting, and only use trusted Composer repositories as a workaround.

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-40261.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-40261.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-40261.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-40261.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-40261.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-40261.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-40261.json"