Skip to content

Use DefaultDllImportSearchPathsAttribute #64

Closed
@jonpryor

Description

@jonpryor

Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1139578
Context: https://liquid.microsoft.com/Web/Object/Read/ms.security/Requirements/Microsoft.Security.SystemsADM.10039#guide

The current security guidance is that the System.Runtime.InteropServices.DefaultDllImportSearchPathsAttribute attribute should be placed either on the assembly or on [DllImport] methods, to control and constrain where LoadLibraryEx() will look for native libraries.

The advice is to use:

[assembly: DefaultDllImportSearchPathsAttribute(DllImportSearchPath.SafeDirectories)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions