Skip to content

Fix/xxe xinclude detection - #3429

Merged
Richard Lundeen (richlundeen) merged 4 commits into
microsoft:mainfrom
aspire488:fix/xxe-xinclude-detection
Oct 25, 2026
Merged

Richard Lundeen (richlundeen) merged 4 commits into
microsoft:mainfrom
aspire488:fix/xxe-xinclude-detection

Conversation

@aspire488

Copy link
Copy Markdown
Contributor

Description

Tests and Documentation

Summary

Adds XXE output detection for XML XInclude elements that reference external resources.

Changes

  • Detects prefixed and unprefixed XInclude elements with external href values using file:, http:, https:, or ftp: schemes.
  • Adds positive test cases for local-file and remote-resource references.
  • Adds negative test cases for relative references and unrelated XML elements to reduce false positives.

Testing

  • Regex smoke tests passed for local-file references, remote URLs, relative references, unrelated XML elements, and unprefixed include elements.
  • The full PyRIT test suite has not yet been run.

Scope

This change addresses the XInclude detection gap discussed in #3324. It complements existing XXE-related coverage without changing unrelated detection behavior.

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.

This pattern is broader than XInclude. It matches an ordinary <include href="https://example.com/help.xml" /> with no XInclude namespace, and it also matches <xi:include data-href="https://example.com/help.xml" /> even though that element has no href attribute. Both now count as successful XXE output.

Please narrow the match and add these negative cases. If recognizing XInclude correctly needs substantially more XML parsing machinery, I would rather close this small extension than add that complexity to a regex scorer.

Reviewed with GitHub Copilot.

Require an exact href attribute and avoid matching ordinary include elements. Cover conventional xi prefixes and explicit default XInclude namespaces.

Co-authored-by: Copilot App <[email protected]>
@richlundeen
Richard Lundeen (richlundeen) added this pull request to the merge queue Oct 25, 2026
Merged via the queue into microsoft:main with commit 0735f4c Oct 25, 2026
72 of 73 checks passed
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.

2 participants