是什么导致接口(或程序集?)成为标记的安全关键?

hlo*_*dal 7 .net c# security xamarin.android mvvmcross

背景

我有一个类 - MobileLogging- 实现MvvmCross'IMvxTrace接口(来自参考Cirrious.MvvmCross.Droid packages\MvvmCross.HotTuna.CrossCore.3.5.0\lib\MonoAndroid\Cirrious.CrossCore.dll):

namespace Cirrious.CrossCore.Platform
{
    public interface IMvxTrace
    {
        void Trace(MvxTraceLevel level, string tag, Func<string> message);
        void Trace(MvxTraceLevel level, string tag, string message);
        void Trace(MvxTraceLevel level, string tag, string message, params object[] args);
    }
}
Run Code Online (Sandbox Code Playgroud)

从代码工作的角度来看,一切都很好.但是,当选择"运行代码分析解决方案"时,它会产生许多安全警告:

  • CA2140透明代码不得引用安全关键项
  • CA2151具有关键类型的字段应该是安全关键的.
  • CA2146类型必须至少与其基本类型和接口一样重要
  • CA2123覆盖链接要求应与base相同
  • CA2134覆盖基本方法时,方法必须保持一致的透明度

运行SecAnnotate.exe会生成包含其他内容的TransparencyAnnotations.xml

  <type name="<...mynamespace...>.MobileLogging">
    <annotations>
      <critical>
        <rule name="TypesMustBeAtLeastAsCriticalAsBaseTypes">
          <reason pass="1">Transparent or safe-critical type 'MobileLogging' derives from
          critical type 'IMvxTrace' in violation of the transparency inheritance rules.
          'MobileLogging' must be critical to derive from a critical type or implement a
          critical interface.</reason>
          <reason pass="1">Transparent or safe-critical type 'MobileLogging' derives from
          critical type 'IMobileLogging' in violation of the transparency inheritance
           rules. 'MobileLogging' must be critical to derive from a critical type or
          implement a critical interface.</reason>
        </rule>
      </critical>
    </annotations>
Run Code Online (Sandbox Code Playgroud)

起初我只是假设没问题,日志功能可能在某些时候可能会调用一些本机(非托管)日志记录功能,所以它被标记为安全关键似乎并不太远.但现在我开始认为IMvxTrace被认为是安全关键的事实是错误的.

首先,因为在查看MvvmCross的代码库时,没有任何内容表明任何安全级别或任何规范,实际上搜索字符串"secur"只匹配两行

SecureTextEntry = isPassword,
using System.Security.Cryptography;
Run Code Online (Sandbox Code Playgroud)

在google上搜索"IMvxTrace critical"只返回5场比赛,其中没有一项与我相关.

因此,假设IMvxTrace被错误地标记为安全关键,可能的原因是什么,我该如何解决?