Skip to content

Fix missing XML validation false positives - #410

Open
Chanel (chanel-y) wants to merge 1 commit into
mainfrom
missing-xml-fp-fix
Open

Chanel (chanel-y) wants to merge 1 commit into
mainfrom
missing-xml-fp-fix

Conversation

@chanel-y

@chanel-y Chanel (chanel-y) commented Nov 10, 2026 •

Copy link
Copy Markdown

Change 1 - Recognize schema validation in XML reader settings initializers

For example:

var settings = new XmlReaderSettings
{
    ValidationType = ValidationType.Schema
};
settings.Schemas.Add("urn:my-schema", "my.xsd");
XmlReader.Create(new StringReader(xml), settings);

was still being flagged because it was in an object initializer

2 - exclude Stream.Null from tainted XML inputs.

Port of Raul's initial query fix, okta just hates him so doing it on his behalf

Recognize schema validation in XML reader settings initializers and exclude Stream.Null from tainted XML inputs. Add regression cases for unsafe settings mutations and fix missing source annotations in the supplied tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 490de35b-0565-4725-9bcb-f1f383e3f2f1

This branch has not been deployed

No deployments
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.

1 participant