Skip to content

Harden Build Failure Analysis archive extraction - #56539

Merged
Evangelink merged 3 commits into
dotnet:mainfrom
YuliiaKovalova:fix-bfa-archive-entry-validation
Oct 8, 2026
Merged

Evangelink merged 3 commits into
dotnet:mainfrom
YuliiaKovalova:fix-bfa-archive-entry-validation

Conversation

@YuliiaKovalova

Copy link
Copy Markdown
Member

Summary

  • validate ZIP entry metadata before extracting untrusted Azure Pipelines artifacts
  • reject absolute/traversal/drive paths and symlink, device, FIFO, socket, or other special entries
  • cap archives at 65,536 entries and exercise the production validator with regression fixtures
  • give manual Build Failure Analysis dispatches distinct conclusion-concurrency slots

Validation

  • python .github/workflows/tests/test_archive_validation.py
  • gh-aw v0.89.21 strict compile + schema validation: 2 workflows, 0 warnings
  • actionlint v1.7.12 with the documented gh-aw extension ignores

Copilot AI balanced review requested due to automatic review settings October 7, 2026 14:37
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

Copilot review overview

🟡 Changes recommended

The entry cap is checked only after all untrusted ZIP metadata is loaded, leaving a memory-exhaustion path.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Hardens Build Failure Analysis when extracting untrusted Azure Pipelines ZIP artifacts.

Changes:

  • Validates entry paths/types and caps entry counts.
  • Adds archive-validation regression tests.
  • Separates generated concurrency slots by run ID.
File Description
.github/​workflows/​tests/​test_archive_validation.py Tests accepted and rejected ZIP metadata.
.github/​workflows/​tests/​.gitignore Ignores Python cache files.
.github/​workflows/​shared/​build-failure-analysis-fetch.md Adds archive metadata validation.
.github/​workflows/​build-failure-analysis.md Adds a run-specific job discriminator.
.github/​workflows/​build-failure-analysis.lock.yml Regenerates the automatic workflow.
.github/​workflows/​build-failure-analysis-command.lock.yml Regenerates the command workflow.

@Evangelink
Evangelink merged commit f346198 into dotnet:main Oct 8, 2026
14 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 9, 2026
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.

3 participants