Skip to content

Skip approved archive scans before loading large ZIPs - #6638

Open
Slai.life (huong8373tt-beep) wants to merge 3 commits into
microsoft:masterfrom
huong8373tt-beep:fix/6632-skip-local-archive-scan
Open

Slai.life (huong8373tt-beep) wants to merge 3 commits into
microsoft:masterfrom
huong8373tt-beep:fix/6632-skip-local-archive-scan

Conversation

@huong8373tt-beep

@huong8373tt-beep Slai.life (huong8373tt-beep) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

📖 Description

Resolves #6632.

When a local manifest explicitly requests --ignore-local-archive-malware-scan and the administrator setting permits that override, WinGet now skips the archive malware scan before loading the ZIP. This avoids the scan's full-archive memory allocation for approved large archive installs, including the x86 validation scenario described in the issue.

The default scan path is unchanged when the override is absent or not permitted. The installer workflow still performs the normal archive extraction and nested-installer validation steps.

🔗 References

Resolves #6632

🔍 Validation

  • Added regression coverage to verify the approved override does not call Archive::ScanZipFile() and reports the skip to the user.
  • Preserved coverage for scan failure when the override is not permitted.
  • Parsed the updated resource XML successfully.
  • git diff --check passed.
  • Merge-ReleaseNotes.ps1 -Version 1.31 passed.
  • A focused native C++ build was attempted, but local vcpkg dependency acquisition was blocked while downloading the Brotli source archive; the test binary was not produced or run. GitHub CI remains the full build-and-test authority for this change.

✅ Checklist

🤖 AI Assistance

  • AI assistance was used and has been disclosed in this PR
  • No AI assistance was used

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

@azure-pipelines

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

@huong8373tt-beep
Slai.life (huong8373tt-beep) marked this pull request as ready for review October 30, 2026 10:50
@huong8373tt-beep
Slai.life (huong8373tt-beep) requested a review from a team as a code owner October 30, 2026 10:50
Comment thread src/AppInstallerCLITests/TestHooks.h Outdated
bool m_status;
};

struct SetScanArchiveCalled_Override

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
struct SetScanArchiveCalled_Override
struct SetScanArchiveCalled_Signal

This is not an override, but a reporting mechanism.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The native regression test was not built or run and mocks extraction, so Windows/x86 validation is still needed to confirm large-ZIP installation succeeds after bypassing the scan.

No open issues 🎉

What changed in this PR

Addresses #6632 by skipping local archive malware scanning before loading the ZIP when both the override flag and administrator setting permit it. This avoids the scan’s full-archive memory allocation while preserving normal scanning otherwise and leaving extraction and nested-installer validation unchanged.

Changes:

  • Moves the approved override check ahead of ScanZipFile().
  • Adds regression coverage confirming the scanner is not called and the skip message is displayed.
  • Updates the user-facing resource and adds a release note.
File Description
src/​AppInstallerCommonCore/​Archive.cpp Adds a test hook to track scanner invocation.
src/​AppInstallerCLITests/​TestHooks.h Adds a scoped wrapper for the invocation-tracking hook.
src/​AppInstallerCLITests/​InstallFlow.cpp Verifies approved overrides skip scanning and notify users.
src/​AppInstallerCLIPackage/​Shared/​Strings/​en-us/​winget.resw Replaces the scan-failure override message with a scan-skipped message.
src/​AppInstallerCLICore/​Workflows/​ArchiveFlow.cpp Returns before scanning when the override is approved.
src/​AppInstallerCLICore/​Resources.h Declares the replacement resource identifier.
doc/​release-notes/​1.31/​6632-local-archive-scan-override.md Documents reduced memory use for approved archive scan overrides.

Review effort: Balanced

@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Applied the review suggestion in d9bc729: renamed SetScanArchiveCalled_Override to SetScanArchiveCalled_Signal, since it reports whether the scanner was called rather than overriding scan behavior. No functional behavior changed.

Comment thread src/AppInstallerCLITests/TestHooks.h Outdated
{
SetScanArchiveCalled_Signal()
{
AppInstaller::Archive::TestHook_SetScanArchiveCalled_Override(&m_status);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was also expecting that these would have the name updated as well.

@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Addressed the maintainer naming request: the archive-called test hook is now consistently named SetScanArchiveCalled_Signal in the public test hook, implementation, and test usage. Also normalized the release-note file to end with a newline. Commit: c483e3f. Local Windows build reached the repository C++/WinRT/vcpkg stage but was blocked by the shared vcpkg filesystem lock; no code assertion failure was observed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x86 validation: bad allocation before extracting ~614 MiB portable ZIPs (1.29.280)

4 participants