{"id":"CVE-2026-145738","state":"PUBLISHED","title":"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 /tm","description":"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.","publishedAt":"2026-12-06T06:45:13.944Z","updatedAt":"2026-12-06T06:46:56.593Z","severity":{"score":5.2,"label":"Medium","version":"4.0","vector":"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","source":"mitre"},"assigner":"mitre","products":["cweagans Composer Patches"],"affected":[{"vendor":"cweagans","product":"Composer Patches","defaultStatus":"unknown","versions":[{"version":"2.0.0","status":"affected","versionType":"semver"}],"modules":["Patch downloader and cache"],"programFiles":["src/Downloader.php","src/Downloader/ComposerDownloader.php"],"programRoutines":[{"name":"ComposerDownloader::download()"},{"name":"Downloader::__construct()"}],"repo":"https://github.com/cweagans/composer-patches"}],"references":["https://github.com/cweagans/composer-patches/issues/654"],"weaknesses":["CWE-379"],"ingestedAt":"2026-12-06T06:56:05.750Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/145xxx/CVE-2026-145738.json","commit":"d1af34608f3ea596b43bbab1a7cd743d9eb12605","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-145738","state":"PUBLISHED","datePublished":"2026-12-06T06:45:13.944Z","dateUpdated":"2026-12-06T06:46:56.593Z","assignerShortName":"mitre","assignerOrgId":"8254265b-2729-46b6-b9e3-3dfca2d5bfca","dateReserved":"2026-12-06T06:45:13.537Z"},"containers":{"cna":{"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."}],"affected":[{"vendor":"cweagans","product":"Composer Patches","defaultStatus":"unknown","versions":[{"version":"2.0.0","status":"affected","versionType":"semver"}],"modules":["Patch downloader and cache"],"programFiles":["src/Downloader.php","src/Downloader/ComposerDownloader.php"],"programRoutines":[{"name":"ComposerDownloader::download()"},{"name":"Downloader::__construct()"}],"repo":"https://github.com/cweagans/composer-patches"}],"references":[{"url":"https://github.com/cweagans/composer-patches/issues/654"}],"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":{"shortName":"mitre","orgId":"8254265b-2729-46b6-b9e3-3dfca2d5bfca","dateUpdated":"2026-12-06T06:46:56.593Z"},"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)"}],"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"}}}}}