C#: Add manual models for more some XML related classes.#20290
C#: Add manual models for more some XML related classes.#20290michaelnebel merged 8 commits intogithub:mainfrom
Conversation
Click to show differences in coveragecsharpGenerated file changes for csharp
- System,"``System.*``, ``System``",47,12165,54,5
+ System,"``System.*``, ``System``",47,12241,54,5
- Totals,,107,14429,407,9
+ Totals,,107,14505,407,9
- System,54,47,12165,,6,5,5,,,4,1,,33,2,,6,15,17,4,3,,5929,6236
+ System,54,47,12241,,6,5,5,,,4,1,,33,2,,6,15,17,4,3,,6003,6238 |
7b1ddb2 to
81f4f82
Compare
XmlDictionaryReader methods.|
DCA looks good. A couple of extra results on |
There was a problem hiding this comment.
Pull Request Overview
This PR adds manual flow models for XML-related classes in the System.Xml namespace to improve dataflow analysis. The goal is to provide comprehensive coverage for XML reading operations that can propagate taint or value flows.
- Added manual models for
System.Xml.XmlReader,System.Xml.XmlTextReader, andSystem.Xml.XmlDictionaryReader - Replaced auto-generated models with manual ones for better precision
- Added models for constructors, read methods, and property getters
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| System.Xml.model.yml | Added 65 new manual flow summary models for XML reader classes |
| FlowSummaries.expected | Updated test expectations with new manual models (added 101 entries, removed 65 auto-generated) |
| FlowSummariesFiltered.expected | Updated filtered test expectations with new manual models (added 37 entries, removed 11 auto-generated) |
| 2025-08-26-xmlreader-models.md | Added changelog entry describing the new XML reader models |
| - ["System.Xml", "XmlReader", True, "ReadValueChunk", "()", "", "Argument[this]", "Argument[0]", "taint", "manual"] | ||
| - ["System.Xml", "XmlReader", True, "ReadValueChunkAsync", "()", "", "Argument[this]", "Argument[0]", "taint", "manual"] |
There was a problem hiding this comment.
The ReadValueChunk methods appear to have incorrect parameter signature. These methods typically take parameters like (System.Char[], System.Int32, System.Int32) for the output buffer, but the signature shows '()' which suggests no parameters.
| - ["System.Xml", "XmlReader", True, "ReadValueChunk", "()", "", "Argument[this]", "Argument[0]", "taint", "manual"] | |
| - ["System.Xml", "XmlReader", True, "ReadValueChunkAsync", "()", "", "Argument[this]", "Argument[0]", "taint", "manual"] | |
| - ["System.Xml", "XmlReader", True, "ReadValueChunk", "(System.Char[],System.Int32,System.Int32)", "", "Argument[this]", "Argument[0]", "taint", "manual"] | |
| - ["System.Xml", "XmlReader", True, "ReadValueChunkAsync", "(System.Char[],System.Int32,System.Int32)", "", "Argument[this]", "Argument[0]", "taint", "manual"] |
There was a problem hiding this comment.
Yes, it does. We even have a neutral generated model with the correct signature.
There was a problem hiding this comment.
Mostly I try and copy the signatures from the neutral models (to avoid such mistakes) - so I don't know how this one slipped.
bf3ba91 to
cbc232c
Compare
cbc232c to
55dd098
Compare
|
DCA still looks good. The failing change note validation is unrelated to this PR. |
Added summary models for
System.Xml.XmlReader,System.Xml.XmlTextReaderandSystem.Xml.XmlDictionaryReader.