ALee665277 (Community Member) asked a question.

Why is XmlPreloadedResolver.ResolveUri(Uri, String) Method generating an XXE flaw?

The method call XmlPreloadedResolver.ResolveUri(Uri, String) returns the Uri given the input values. This is Uri object, why would this be considered an "Improper Restriction of XML External Entity" CWE ID 611. The function is not accessing the XML information, it creates a Uri.


  • Hi @ALee665277 (Community Member)​ ,

     

    The .NET ResolveUri method resolves relative file paths to absolute paths which may cause information leakage and is typically used to determine paths to load, see also excellent research done by VSR now NCCGroup: https://research.nccgroup.com/2014/05/19/xml-schema-dtd-and-entity-attacks-a-compendium-of-known-techniques/ .

    Could you say more about how you're using this API in a context that would not result in XXE?

     

    Thank you,

    Boy Baukema

    Expand Post
  • ALee665277 (Community Member)

    Thanks for the response. Yes, you have methods to restrict/prevent the reading and writing of your XML. This is what you want to prevent from a security stand point. But determining the path of your XML file may not be even related to reading or writing the XML file. You can use this method to show the possible location of the XML file which has nothing to do with reading/writing.

Topics (4)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.