ASP.NET Core Configuration File Detected

medium Web App Scanning Plugin ID 113228

Synopsis

ASP.NET Core Configuration File Detected

Description

ASP.NET Core applications can read configuration data based on key-value pairs from multiple providers and sources. By using the JSON configuration provider, data can be retrieved from predictable configuration files named `appsettings.json` and `appSettings.{Environment}.json`.

Developers sometimes store secrets or other sensitive information in these configuration files. By accessing it, an attacker could leverage the vulnerability to gain unauthorized and privileged access to one or multiple components of the web application.

Solution

Ensure that the configuration file is not deployed with the application or, at least, is not exposed in a web server directory by setting proper permissions on it. Note that application secrets should not be directly defined in the configuration file and should instead rely on Microsoft secret storage best practices.

See Also

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/

https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets

Plugin Details

Severity: Medium

ID: 113228

Type: remote

Published: 5/18/2022

Updated: 5/18/2022

Scan Template: api, basic, full, pci, scan

Risk Information

VPR

Risk Factor: Low

Score: 1.4

CVSS v2

Risk Factor: Medium

Base Score: 5

Vector: CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N

CVSS Score Source: Tenable

CVSS v3

Risk Factor: Medium

Base Score: 5.3

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

CVSS Score Source: Tenable

Reference Information