Repository navigation
Block implicit network-file access in XML resource resolution - #544
Open
Will Portnoy (willportnoy) wants to merge 5 commits into
Open
Will Portnoy (willportnoy) wants to merge 5 commits into
Will Portnoy (willportnoy) wants to merge 5 commits into
Conversation
Cover opening and validation with an in-memory schema source. Four network-schema assertions intentionally fail before the product fix; local-schema and no-schema controls pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 38cfa7db-d690-4e7f-a2ff-a38a5e8015b5
Reject UNC aliases, mapped network drives, and unknown drive roots before synchronous or asynchronous resource I/O. Cover schemas, external DTDs/entities, XInclude, XSLT imports and document(), and cached-file metadata checks. Preserve local and HTTP(S) sources and explicitly selected input files. Remove automatic Windows target credentials and expand mocked regressions across .NET Framework 4.8 and .NET 8. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 38cfa7db-d690-4e7f-a2ff-a38a5e8015b5
Classify lexical drive roots before filesystem-backed normalization. Guard schema-set preprocessing and stylesheet DOM reloads. Preserve explicit comparison inputs and the XmlTextReader contract while guarding their references. Add focused regressions and run the headless model suite in both desktop CI configurations. All 43 cases pass on .NET Framework 4.8 and .NET 8 in Debug and Release. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 38cfa7db-d690-4e7f-a2ff-a38a5e8015b5
Use Path.GetRandomFileName for the in-memory document base and Path.GetTempFileName for the owned file fixture, clarifying relative-path and file-ownership intent without CodeQL suppressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 38cfa7db-d690-4e7f-a2ff-a38a5e8015b5
Use the framework-owned temporary-file path for the in-memory document base, remove its placeholder before loading to avoid file watching, and clean up the owned path if initialization fails. This removes the remaining CodeQL path-combine note without suppression. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 38cfa7db-d690-4e7f-a2ff-a38a5e8015b5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent automatic Windows network-file access when XML Notepad resolves XML/XSLT resources.
document(), including asynchronous calls.Network-share dependencies, including mapped-drive paths, are intentionally blocked. Copy these dependencies locally or serve them over HTTP(S). Explicitly selected main documents and comparison inputs can still reside on network storage.
Regression coverage
Add a headless, mock-backed test project covering resource resolution, URI aliases, drive classification, schema imports, DTDs/entities, XInclude, XSLT, and explicitly selected input documents. The tests do not contact network shares or capture authentication material.
Run these regression tests in the existing Windows CI Debug and Release jobs.
Validation