79777902

Date: 2025-09-29 08:50:20
Score: 3
Natty:
Report link

To showcase the security attributes, we've modified the sample source code to evaluate the method triggering the error in order to show it's security attributes:

Type type = new Microsoft.Ink.Recognizers().GetType();

//get the MethodInfo object of the current method 
MethodInfo m = type.GetMethods().FirstOrDefault
    (method => method.Name == "GetDefaultRecognizer"
    && method.GetParameters().Count() == 0); ;
//show if the current method is Critical, Transparent or SafeCritical
Console.WriteLine("Method GetDefaultRecognizer IsSecurityCritical: {0} \n", m.IsSecurityCritical);
Console.WriteLine("Method GetDefaultRecognizer IsSecuritySafeCritical: {0} \n", m.IsSecuritySafeCritical);
Console.WriteLine("Method GetDefaultRecognizer IsSecurityTransparent: {0} \n", m.IsSecurityTransparent);

That code generates this output:

Method GetDefaultRecognizer IsSecurityCritical: False
Method GetDefaultRecognizer IsSecuritySafeCritical: False
Method GetDefaultRecognizer IsSecurityTransparent: True

Because the method in the Microsoft.Ink library is processed as SecurityTransparent, and errors are arising, it needs to be tagged as either SecurityCritical or SecuritySafeCritical.

Is there anything we can do at our code level?

Reasons:
  • Blacklisted phrase (1): Is there any
  • Long answer (-1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Manuel Castro