Avoid storing passwords in the config files | CAST Appmarq

Avoid storing passwords in the config files


Rule Definition
Failure frequently compromises all data that should have been protected. Typically, this information includes sensitive personal information (PII) data such as health records, credentials, personal data, and credit cards, which often require protection as defined by laws or regulations such as the EU GDPR or local privacy laws.

Remediation
Username and password information should not be included in a configuration file or a properties file in plaintext as this will allow anyone who can read the file access to the resource. If possible, encrypt this information

Violation Code Sample
<connectionStrings>
<add name="ud_DEV" connectionString="connectDB=uDB; uid=db2admin; pwd=password; dbalias=uDB;" providerName="System.Data.Odbc" />
</connectionStrings>
...
Fixed Code Sample
<connectionStrings>
<add name="ud_DEV" connectionString="connectDB=uDB;  dbalias=uDB;" providerName="System.Data.Odbc" />
</connectionStrings>
...

Reference
CWE-260: Password in Configuration File https://cwe.mitre.org/data/definitions/260.html https://www.owasp.org/index.php/Top_10-2017_A6-Security_Misconfiguration A6-Security_Misconfiguration

Related Technologies

Health Factor

  Total Quality Index


Technical Criterion
Secure Coding - API Abuse

About CAST Appmarq

CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.

Benchmark Statistics

Global Compliance

nan%

Total Violations
0
Total Opportunities
0
Average Violations / App.
nan
The compliance score represents 1 minus the ratio between the number of times a rule has been violated compared to the number of opportunities in a set of applications that the rule could have been violated.

Industry Insights

Select from drop-down

88.00%

Utilities

9.52%

Software ISV

61.19%