Contain DI software packages beneath their configured root (OPC 10000-100)#4053
Contain DI software packages beneath their configured root (OPC 10000-100)#4053marcschier wants to merge 2 commits into
Conversation
…-100) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Hardens FileSystemPackageStore path handling so DI software packages (payload + metadata) are always contained under the configured provider root, preventing dot-segment/path normalization from escaping the store root.
Changes:
- Add canonicalization + strict descendant checks for provider paths in
FileSystemPackageStore. - Reject dot segments (
./..) in package identifiers and configured roots. - Add regression tests covering dot-segment rejection and root canonicalization.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/Opc.Ua.Di.Tests/PackageStoreTests.cs | Adds tests for dot-segment rejection and deterministic root canonicalization behavior. |
| src/Opc.Ua.Di.Server/SoftwareUpdate/FileSystemPackageStore.cs | Canonicalizes provider paths, rejects dot segments, and blocks paths from escaping configured root. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4053 +/- ##
==========================================
- Coverage 73.55% 73.52% -0.04%
==========================================
Files 1345 1345
Lines 180036 180038 +2
Branches 31677 31678 +1
==========================================
- Hits 132427 132374 -53
- Misses 36911 36955 +44
- Partials 10698 10709 +11 🚀 New features to boost your workflow:
|
Description
This PR splits the DI software-package containment changes from #4021.
Specification
The provider-backed package cache must therefore keep each package payload and its metadata together beneath the configured store root.
Failure
FileSystemPackageStorerejected path separators in package identifiers but accepted.and... It also accepted configured roots containing dot segments. Provider path normalization could therefore resolve a package operation outside the configured package-store root.Fix
Validation
Opc.Ua.Di.Tests: net10.0 (288 passed), net48 (288 passed).PackageStoreTests: net10.0 (15 passed), net48 (15 passed).git diff --checkpassed.Related Issues
Checklist
Only verified claims are checked.