{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2026-145738",
        "assignerOrgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
        "state": "PUBLISHED",
        "assignerShortName": "mitre",
        "dateReserved": "2026-12-06T06:45:13.537Z",
        "datePublished": "2026-12-06T06:45:13.944Z",
        "dateUpdated": "2026-12-06T06:46:56.593Z"
    },
    "containers": {
        "cna": {
            "affected": [
                {
                    "defaultStatus": "unknown",
                    "modules": [
                        "Patch downloader and cache"
                    ],
                    "product": "Composer Patches",
                    "programFiles": [
                        "src/Downloader.php",
                        "src/Downloader/ComposerDownloader.php"
                    ],
                    "programRoutines": [
                        {
                            "name": "ComposerDownloader::download()"
                        },
                        {
                            "name": "Downloader::__construct()"
                        }
                    ],
                    "repo": "https://github.com/cweagans/composer-patches",
                    "vendor": "cweagans",
                    "versions": [
                        {
                            "status": "affected",
                            "version": "2.0.0",
                            "versionType": "semver"
                        }
                    ]
                }
            ],
            "configurations": [
                {
                    "lang": "en",
                    "supportingMedia": [
                        {
                            "base64": false,
                            "type": "text/html",
                            "value": "<div>Use composer-patches on a shared UNIX-like system either,</div><div><br></div><div>a) without a composer cache (attack is trivial)</div><div>b) with remote patches (requires winning an easy race condition)<br></div>"
                        }
                    ],
                    "value": "Use composer-patches on a shared UNIX-like system either,\n\n\n\n\na) without a composer cache (attack is trivial)\n\nb) with remote patches (requires winning an easy race condition)"
                }
            ],
            "descriptions": [
                {
                    "lang": "en",
                    "value": "The cweagans composer-patches (aka Composer Patches) plugin 2.0.0 for Composer allows local users to gain privileges by modifying patches stored in the /tmp/composer-patches or /tmp/patches directory."
                }
            ],
            "metrics": [
                {
                    "cvssV4_0": {
                        "Automatable": "NOT_DEFINED",
                        "Recovery": "NOT_DEFINED",
                        "Safety": "NOT_DEFINED",
                        "attackComplexity": "LOW",
                        "attackRequirements": "NONE",
                        "attackVector": "LOCAL",
                        "baseScore": 5.2,
                        "baseSeverity": "MEDIUM",
                        "privilegesRequired": "LOW",
                        "providerUrgency": "NOT_DEFINED",
                        "subAvailabilityImpact": "LOW",
                        "subConfidentialityImpact": "LOW",
                        "subIntegrityImpact": "LOW",
                        "userInteraction": "PASSIVE",
                        "valueDensity": "NOT_DEFINED",
                        "vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:L/VI:H/VA:L/SC:L/SI:L/SA:L",
                        "version": "4.0",
                        "vulnAvailabilityImpact": "LOW",
                        "vulnConfidentialityImpact": "LOW",
                        "vulnIntegrityImpact": "HIGH",
                        "vulnerabilityResponseEffort": "NOT_DEFINED"
                    },
                    "format": "CVSS",
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "GENERAL"
                        }
                    ]
                }
            ],
            "problemTypes": [
                {
                    "descriptions": [
                        {
                            "cweId": "CWE-379",
                            "description": "CWE-379 Creation of Temporary File in Directory with Insecure Permissions",
                            "lang": "en",
                            "type": "CWE"
                        }
                    ]
                }
            ],
            "providerMetadata": {
                "orgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca",
                "shortName": "mitre",
                "dateUpdated": "2026-12-06T06:46:56.593Z"
            },
            "references": [
                {
                    "url": "https://github.com/cweagans/composer-patches/issues/654"
                }
            ],
            "solutions": [
                {
                    "lang": "en",
                    "supportingMedia": [
                        {
                            "base64": false,
                            "type": "text/html",
                            "value": "There is a pull request at <a target=\"_blank\" rel=\"nofollow\" href=\"https://github.com/cweagans/composer-patches/pull/680\">https://github.com/cweagans/composer-patches/pull/680</a> that solves the remote ComposerDownloader problem, but not the cache problem."
                        }
                    ],
                    "value": "There is a pull request at  https://github.com/cweagans/composer-patches/pull/680  that solves the remote ComposerDownloader problem, but not the cache problem."
                }
            ],
            "workarounds": [
                {
                    "lang": "en",
                    "supportingMedia": [
                        {
                            "base64": false,
                            "type": "text/html",
                            "value": "<div>For now, overriding the system temporary directory used by php is an easy way to avoid both problems. This can be accomplished with something like <code>php -d sys_temp_dir=/path/writable/only/by/me composer ...</code>\n</div>"
                        }
                    ],
                    "value": "For now, overriding the system temporary directory used by php is an easy way to avoid both problems. This can be accomplished with something like php -d sys_temp_dir=/path/writable/only/by/me composer ..."
                }
            ],
            "x_generator": {
                "engine": "CVE-Request-form 0.0.1"
            }
        }
    }
}