You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C#: unmanaged-code queries flag runtime-provided UnsafeAccessor methods and calls #23370
In a .NET 11 build of the public CleanArchitecture fork (commit 2750ea8d7047e33feaad747773f0a8abb611cb4a), CodeQL CLI 2.27.6 with the csharp security-and-quality suite reports eight findings on Vogen 8.0.7 generated EF Core converters: four declarations of extern methods annotated with System.Runtime.CompilerServices.UnsafeAccessorAttribute, and four calls to them.
All 15 generated-code alert locations were inspected against locally regenerated sources from the same commit, using dotnet build Clean.Architecture.slnx -c Release -p:EmitCompilerGeneratedFiles=true.
Expected behavior
Do not classify runtime-provided UnsafeAccessor methods targeting managed members, or calls to them, as native unmanaged code merely because of the extern modifier. The runtime provides the implementation; this is not P/Invoke.
The current queries UnmanagedCodeCheck.ql and CallsUnmanagedCode.ql appear to rely on m.isExtern() without distinguishing UnsafeAccessor.
Scope
This is a quality-query false-positive candidate, not a vulnerability report. A separate minimal CodeQL database was not built; the observations come from the actual hosted scan and the corresponding regenerated C# files. No query suppression or local generator modification was applied.
Activity