-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SONARPHP-957 Fix uri detection in HardCodedCredentialsCheck (#531)
- Loading branch information
1 parent
d7c155f
commit dd9dcf1
Showing
2 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,15 +69,19 @@ function foo() { | |
// The literal string doesn't contain the wordlist item matched on the variable name | ||
const DEFAULT_AMQP_PASSWORD = 'pwd'; // Noncompliant | ||
|
||
$uri = "scheme://user:[email protected]"; // Noncompliant | ||
$uri = "ftp://user:[email protected]"; // Noncompliant | ||
$uri = "ssh://user:[email protected]"; // Noncompliant | ||
$uri = "scheme://user:@domain.com"; // Compliant | ||
$uri = "scheme://[email protected]:80"; // Compliant | ||
$uri = "scheme://[email protected]"; // Compliant | ||
$uri = "scheme://domain.com/user:azerty123"; // Compliant - valid url without credentials | ||
$uri = "scheme://admin:[email protected]"; // Compliant | ||
$uri = "https://user:[email protected]"; // Noncompliant | ||
$uri = "http://user:[email protected]"; // Noncompliant | ||
$uri = "https://user:@domain.com"; // Compliant | ||
$uri = "https://[email protected]:80"; // Compliant | ||
$uri = "http://[email protected]"; // Compliant | ||
$uri = "https://domain.com/user:azerty123"; // Compliant - valid url without credentials | ||
$uri = "https://admin:[email protected]"; // Compliant | ||
Request::create('http://user:[email protected]'); // Compliant - often used for tests | ||
Request::create('https://username:[email protected]'); // Compliant - often used for tests | ||
preg_match('#(^git://|\.git/?$|git(?:olite)?@|//git\.|//github.com/)#i', $url); // Compliant | ||
$gitUri = "https://user:[email protected]/username/repository.git"; // Noncompliant | ||
|
||
ldap_bind("a", "b", "p4ssw0rd"); // Noncompliant | ||
$conection = new PDO("a", "b", "p4ssw0rd"); // Noncompliant | ||
|