Skip to content

Fix: Add missing subsystem-level security tests for Utilities#91

Merged
Malcolmnixon merged 1 commit intomainfrom
copilot/perform-formal-review-steps
Apr 5, 2026
Merged

Fix: Add missing subsystem-level security tests for Utilities#91
Malcolmnixon merged 1 commit intomainfrom
copilot/perform-formal-review-steps

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

Summary

Performed formal reviews of all 14 review-sets defined in .reviewmark.yaml. 13 review-sets passed without issues. One issue was identified in the SarifMark-Utilities review-set.

Issue Found

The UtilitiesTests.cs subsystem test file contained only one test (happy path), but the subsystem requirement SarifMark-Utilities-SafePathHandling emphasizes preventing path-traversal vulnerabilities. The subsystem-level tests did not directly demonstrate the security properties — reviewers had to descend to unit-level tests to verify them.

Changes

test/DemaConsulting.SarifMark.Tests/Utilities/UtilitiesTests.cs

Added three new subsystem-level tests that demonstrate the security capabilities at the subsystem level:

  • Utilities_SafePathHandling_PathTraversal_ThrowsException — proves path-traversal attacks are rejected
  • Utilities_SafePathHandling_AbsolutePath_ThrowsException — proves absolute paths are rejected
  • Utilities_SafePathHandling_NullInput_ThrowsException — proves null inputs are rejected

docs/reqstream/sarifmark/utilities/utilities.yaml

Updated requirement SarifMark-Utilities-SafePathHandling to declare the three new tests.

Verification

All 128 tests pass across .NET 8, 9, and 10.

Review Reports

All 14 formal review reports are saved to .agent-logs/ (not committed):

  • review-SarifMark-Purpose.md → PASSED
  • review-SarifMark-Architecture.md → PASSED
  • review-SarifMark-Design.md → PASSED
  • review-SarifMark-AllRequirements.md → PASSED
  • review-SarifMark-Cli.md → PASSED
  • review-SarifMark-Sarif.md → PASSED
  • review-SarifMark-SelfTest.md → PASSED
  • review-SarifMark-Utilities.mdISSUES FOUND (fixed by this PR)
  • review-SarifMark-Program.md → PASSED
  • review-SarifMark-Cli-Context.md → PASSED
  • review-SarifMark-Sarif-SarifResult.md → PASSED
  • review-SarifMark-Sarif-SarifResults.md → PASSED
  • review-SarifMark-SelfTest-Validation.md → PASSED
  • review-SarifMark-Utilities-PathHelpers.md → PASSED

- Add Utilities_SafePathHandling_PathTraversal_ThrowsException test
- Add Utilities_SafePathHandling_AbsolutePath_ThrowsException test
- Add Utilities_SafePathHandling_NullInput_ThrowsException test
- Update utilities.yaml to declare the new tests

Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/038c3c55-6bc1-4026-9215-6141f712609b

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI requested a review from Malcolmnixon April 5, 2026 17:23
@Malcolmnixon Malcolmnixon marked this pull request as ready for review April 5, 2026 20:18
Copilot AI review requested due to automatic review settings April 5, 2026 20:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR strengthens the Utilities subsystem security verification by adding subsystem-level tests that explicitly demonstrate PathHelpers.SafePathCombine rejects unsafe inputs (path traversal, absolute paths, null), and then links those tests to the relevant subsystem requirement so reviewers don’t need to rely on unit tests to confirm the security behavior.

Changes:

  • Added three new subsystem-level negative tests in UtilitiesTests.cs for traversal, absolute paths, and null input handling.
  • Updated the Utilities requirement doc to reference the new tests under SarifMark-Utilities-SafePathHandling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
test/DemaConsulting.SarifMark.Tests/Utilities/UtilitiesTests.cs Adds subsystem-level security tests asserting unsafe path inputs are rejected.
docs/reqstream/sarifmark/utilities/utilities.yaml Links the new subsystem tests to SarifMark-Utilities-SafePathHandling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Malcolmnixon Malcolmnixon merged commit d9b1052 into main Apr 5, 2026
19 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/perform-formal-review-steps branch April 5, 2026 21:38
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