Skip to content

[AutoPR- Security] Patch packer for CVE-2026-19589 [HIGH] - #18525

Draft
Azure Linux Security Servicing Account (azurelinux-security) wants to merge 2 commits into
microsoft:fasttrack/3.0from
azurelinux-security:azure-autosec/packer/3.0/1185585
Draft

[AutoPR- Security] Patch packer for CVE-2026-19589 [HIGH]#18525
Azure Linux Security Servicing Account (azurelinux-security) wants to merge 2 commits into
microsoft:fasttrack/3.0from
azurelinux-security:azure-autosec/packer/3.0/1185585

Conversation

@azurelinux-security

@azurelinux-security Azure Linux Security Servicing Account (azurelinux-security) commented Aug 19, 2026

Copy link
Copy Markdown

Auto Patch packer for CVE-2026-19589.

Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1185585&view=results

CVE-2026-19589 : Single Patch Backporter Pipeline Run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1185590&view=results

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

What does the PR accomplish, why was it needed?

Change Log
Does this affect the toolchain?

YES/NO

Associated issues
  • N/A
Links to CVEs
Test Methodology

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@v-swapsahu

v-swapsahu commented Aug 22, 2026

Copy link
Copy Markdown

Patch Analysis:
CVE-2026-19589
Backported: Yes

Issue: When installing a plugin, Packer trusted the filename listed in the remote SHA256SUMS file to decide where to write the binary. A malicious release using a name like packer-plugin-docker_v1.2.3_x5.0_linux_amd64/../../tmp/PWNED.zip_ causes Packer to write outside the plugin directory → arbitrary file write.

Affected: Azure Linux ships packer 1.9.5 → affected. Upstream fix da95976 targets code that doesn't exist verbatim in 1.9.5, so it is backported.

Root cause: In plugins.go::InstallLatest, the entry is parsed/validated but the code then used the raw checksum.Filename to build outputFileName = filepath.Join(outputFolder, ...), so ../ escapes the folder at os.OpenFile().

Fix:
Rebuild the filename from the already-validated entry fields instead of the raw name, via a new Getter.ExpectedFileName(...) method — same design as upstream. Two adaptations were required for 1.9.5:

  • pr.Identifier.Type instead of upstream's pr.Identifier.Source (1.9.5 addrs.Plugin has no Source field).
  • Exported accessors entry.BinVersion()/ProtVersion()/Os()/Arch()/Ext() instead of upstream's exported struct fields (1.9.5 fields are unexported).

Testing: Upstream's scenario test is in getter_test.go (absent from Azure source) and %check doesn't run the plugin-getter package, so no test is shipped.

Verification is done out-of-band via a standalone POC that drives the real InstallLatest with a malicious checksum entry and asserts nothing is written outside the install folder:

  • Unpatched 1.9.5 → FAILS (writes …/hashicorp/PWNED, escaping the plugin dir).
image
  • With the backport → PASSES (safe filename rebuilt; nothing escapes).
image

Patch Application:

image (9)

Local Build have been passed:

image (10)

@Kanishk-Bansal

Copy link
Copy Markdown

/azurepipelines run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants