Skip to content

[Medium] Patch Tar for CVE-2025-45582. - #18248

Open
AkarshHCL wants to merge 3 commits into
microsoft:3.0-devfrom
AkarshHCL:topic_tar_cve-2025-45582
Open

[Medium] Patch Tar for CVE-2025-45582.#18248
AkarshHCL wants to merge 3 commits into
microsoft:3.0-devfrom
AkarshHCL:topic_tar_cve-2025-45582

Conversation

@AkarshHCL

@AkarshHCL AkarshHCL commented Jul 29, 2026

Copy link
Copy Markdown
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
  • Patch tar for CVE-2025-45582.
  1. This patch was originally taken from fixed tar version 1.35+dfsg-4ubuntu0.2 from
    Ubuntu 26.04 LTS resolute and modified to work with the current Azure Linux version of tar.

Reference: https://ubuntu.com/security/CVE-2025-45582

  1. Backport of patches at -https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/tar/1.35%2Bdfsg-4ubuntu0.2/tar_1.35%2Bdfsg-4ubuntu0.2.debian.tar.xz

3.Squashed backport of the GNU tar openat2 extraction-jail commit series plus the supporting gnulib openat2 module, imported from Ubuntu tar_1.35+dfsg-4ubuntu0.2 (debian/patches CVE-2025-45582-1..10 and -gnulib-1..6). The out-of-scope extrac26.at test registration (from CVE-2026-5704, not applied here) was dropped so patches 9 and 10 apply on tar 1.35.

-This PR also includes two follow-up changes to the same tar spec:

Adding export in line-'export FORCE_UNSAFE_CONFIGURE=1 ' due to reason-

Our CVE fix changes some of tar's build-setup files (aclocal.m4, m4/*.m4, gnu/Makefile.am). Because of that, when make runs, it notices the build scripts changed and re-runs ./configure by itself, a second time.

The build happens as the root user, and tar refuses to run ./configure as root unless FORCE_UNSAFE_CONFIGURE=1 is set. The old spec set this variable only for the first, hand-written configure call — so the second call (the one make starts automatically) didn't have it and the build failed.

Using export makes the variable available to every command in the build step, including that automatic second configure. So both runs pass the check and the build succeeds.

This wasn't needed before because the earlier patches only touched test files, which never cause configure to re-run.

Change Log
  • new file: SPECS/tar/CVE-2025-45582.patch
  • modified: SPECS/tar/tar.spec
Does this affect the toolchain?

NO

Links to CVEs
Test Methodology
  • Local package build was successful.-
image - patch is getting applied cleanly- image
  • Package tests passed with RUN_CHECK=y.

@AkarshHCL
AkarshHCL requested a review from a team as a code owner July 29, 2026 11:13
@azure-pipelines

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

@AkarshHCL
AkarshHCL marked this pull request as draft July 29, 2026 11:13
@microsoft-github-policy-service microsoft-github-policy-service Bot added Packaging 3.0-dev PRs Destined for AzureLinux 3.0 labels Jul 29, 2026
@AkarshHCL AkarshHCL changed the title Patch for CVE-2025-45582. [Medium] Patch Tar for CVE-2025-45582. Jul 29, 2026
@AkarshHCL

Copy link
Copy Markdown
Author

Comment thread SPECS/tar/tar.spec Outdated
%build
FORCE_UNSAFE_CONFIGURE=1 ./configure \
export FORCE_UNSAFE_CONFIGURE=1
./configure \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly check the indentation.

@v-aaditya

v-aaditya commented Jul 30, 2026

Copy link
Copy Markdown

Peer-review -

  1. The CVE fix is referenced from Ubuntu's fix in tar version 1.35+dfsg-4ubuntu0.2 on Ubuntu 26.04 LTS. Link - https://ubuntu.com/security/CVE-2025-45582
  2. The patch file completely matches with the upstream patch referred from Ubuntu.
  3. The patch has upstream patch reference.
  4. The patch applies cleanly. (Checked .rpm.log)
  5. Adding export FORCE_UNSAFE_CONFIGURE=1 in %build section in spec file was needed as the build was getting failed and reasoning is correct.
  6. The pTest are getting executed and passed. (Checked .rpm.test.log)
  7. The latest Buddy Build is successful.
  8. PR has security tag.

Final verdict - Changes LGTM. PR can be opened for FTE review.

@AkarshHCL
AkarshHCL marked this pull request as ready for review July 30, 2026 06:27
@azure-pipelines

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

@Kanishk-Bansal Kanishk-Bansal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch Analysis (consumed the ubuntu patch, security fix logic LGTM)

  • Buddy Build 
  • patch applied during the build (check rpm.log)
  • patch include an upstream reference
  • PR has security tag

@Kanishk-Bansal Kanishk-Bansal added the ready-for-stable-review PR has passed initial review and is now ready for a second-level stable maintainer review label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0-dev PRs Destined for AzureLinux 3.0 Packaging ready-for-stable-review PR has passed initial review and is now ready for a second-level stable maintainer review security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants