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
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.