Skip to content

Fix Tmds.DBus CVE and Zip Slip archive extraction - #38

Merged
cursor[bot] merged 4 commits into
developmentfrom
dependabot/nuget/nuget-1348a1e5ad
Aug 3, 2026
Merged

Fix Tmds.DBus CVE and Zip Slip archive extraction#38
cursor[bot] merged 4 commits into
developmentfrom
dependabot/nuget/nuget-1348a1e5ad

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Aug 3, 2026

Copy link
Copy Markdown

Pinned Tmds.DBus.Protocol at 0.21.3.

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore <dependency name> major version will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
  • @dependabot ignore <dependency name> minor version will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
  • @dependabot ignore <dependency name> will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
  • @dependabot unignore <dependency name> will remove all of the ignore conditions of the specified dependency
  • @dependabot unignore <dependency name> <ignore condition> will remove the ignore condition of the specified dependency and ignore conditions
    You can disable automated security fix PRs for this repo from the Security Alerts page.

Summary by CodeRabbit

  • Security

    • Improved archive extraction protections to block path traversal and ZIP Slip attacks.
    • Prevented update files from writing outside their temporary extraction location.
    • Added validation for rooted, empty, and unsafe archive paths.
  • Bug Fixes

    • Update extraction now safely handles invalid archive entries and extracts matching files reliably.
  • Tests

    • Added coverage for safe and unsafe archive extraction scenarios across supported platforms.

Bumps Tmds.DBus.Protocol from 0.20.0 to 0.21.3

---
updated-dependencies:
- dependency-name: Tmds.DBus.Protocol
  dependency-version: 0.21.3
  dependency-type: direct:production
  dependency-group: nuget
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code labels Aug 3, 2026
Add ArchivePath.GetSafeExtractPath and use it in ExtractAllContents.
Strip archive path components when unzipping updates to temp.
Reference Tmds.DBus.Protocol 0.21.3 directly from the Shell project.

Co-authored-by: Michael <Narehood@users.noreply.github.com>
@cursor cursor Bot changed the title Bump the nuget group with 1 update Fix Tmds.DBus CVE and Zip Slip archive extraction Aug 3, 2026
ZipArchive lives in the System.IO.Compression framework assembly on
net481; reference it from the test project like XenCenterLib does.

Co-authored-by: Michael <Narehood@users.noreply.github.com>
@Narehood

Narehood commented Aug 3, 2026

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Narehood, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 38 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e481634-2d60-468f-8f9d-9f4740110d8e

📥 Commits

Reviewing files that changed from the base of the PR and between a9ad585 and b44c759.

📒 Files selected for processing (2)
  • XenCenterLib.Tests/ArchivePathTests.cs
  • XenModel/Actions/Updates/DownloadUnzipUpdateAction.cs
📝 Walkthrough

Walkthrough

The change adds safe archive path resolution, applies it during extraction, tests traversal handling, restricts update extraction to leaf filenames, and pins Tmds.DBus.Protocol version 0.21.3.

Changes

Archive extraction safety

Layer / File(s) Summary
Safe archive path resolution and extraction
XenCenterLib/Archive/ArchivePath.cs, XenCenterLib/Archive/ArchiveIterator.cs, XenCenterLib.Tests/ArchivePathTests.cs, XenCenterLib.Tests/XenCenterLib.Tests.csproj
ArchivePath.GetSafeExtractPath rejects empty, rooted, and escaping archive paths. ExtractAllContents uses the helper. Tests cover rejected traversal paths and safe nested files.
Update archive entry selection
XenModel/Actions/Updates/DownloadUnzipUpdateAction.cs
Update extraction uses archive entry leaf filenames and skips entries without valid leaf names.

Package version pinning

Layer / File(s) Summary
DBus package pin and lock updates
Directory.Packages.props, XcpNgCenter.Shell/XcpNgCenter.Shell.csproj, XcpNgCenter.Shell/packages.lock.json
The project pins Tmds.DBus.Protocol to 0.21.3. The lock file records System.IO.Pipelines 8.0.0, removes version 0.20.0, updates project dependency versions to 2026.8.3, and removes the net8.0/linux-x64 runtime section.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies both main changes: the Tmds.DBus.Protocol security update and Zip Slip extraction fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dependabot/nuget/nuget-1348a1e5ad

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
XenCenterLib.Tests/ArchivePathTests.cs (1)

1-114: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add tests for the null/empty argument guard clauses.

The XML doc for GetSafeExtractPath documents ArgumentNullException for a null/empty destinationDirectory and InvalidDataException for a null/empty entryName. No test in this file exercises these guard clauses. Add two small Fact tests to lock in this documented contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@XenCenterLib.Tests/ArchivePathTests.cs` around lines 1 - 114, Add two Fact
tests for GetSafeExtractPath: verify null or empty destinationDirectory throws
ArgumentNullException, and null or empty entryName throws InvalidDataException.
Keep the tests focused on the documented guard-clause contract without requiring
filesystem setup.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@XenModel/Actions/Updates/DownloadUnzipUpdateAction.cs`:
- Around line 94-99: Update the extraction path construction in ExtractFile to
create and use a unique temporary subdirectory, using the existing
Path.GetRandomFileName() pattern from the downloaded archive flow, before
combining it with leafName. Ensure each extraction gets its own directory so
identical archive entries and concurrent updates cannot share output paths.

---

Nitpick comments:
In `@XenCenterLib.Tests/ArchivePathTests.cs`:
- Around line 1-114: Add two Fact tests for GetSafeExtractPath: verify null or
empty destinationDirectory throws ArgumentNullException, and null or empty
entryName throws InvalidDataException. Keep the tests focused on the documented
guard-clause contract without requiring filesystem setup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7827394-752d-43e4-89d3-c0d013a650bf

📥 Commits

Reviewing files that changed from the base of the PR and between 78db17f and a9ad585.

📒 Files selected for processing (8)
  • Directory.Packages.props
  • XcpNgCenter.Shell/XcpNgCenter.Shell.csproj
  • XcpNgCenter.Shell/packages.lock.json
  • XenCenterLib.Tests/ArchivePathTests.cs
  • XenCenterLib.Tests/XenCenterLib.Tests.csproj
  • XenCenterLib/Archive/ArchiveIterator.cs
  • XenCenterLib/Archive/ArchivePath.cs
  • XenModel/Actions/Updates/DownloadUnzipUpdateAction.cs

Comment thread XenModel/Actions/Updates/DownloadUnzipUpdateAction.cs Outdated
Use GetRandomFileName for each update extract directory so identical
leaf names and concurrent extractions do not collide. Add guard-clause
tests for null/empty destination and entryName.

Co-authored-by: Michael <Narehood@users.noreply.github.com>
@Narehood

Narehood commented Aug 3, 2026

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cursor
cursor Bot merged commit 6a98c38 into development Aug 3, 2026
6 checks passed
@cursor
cursor Bot deleted the dependabot/nuget/nuget-1348a1e5ad branch August 3, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants