File tree Expand file tree Collapse file tree
src/semmle/javascript/security
test/library-tests/SensitiveActions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,10 +63,11 @@ module HeuristicNames {
6363
6464 /**
6565 * Gets a regular expression that identifies strings that may indicate the presence of data
66- * that is hashed or encrypted, and hence rendered non-sensitive.
66+ * that is hashed or encrypted, and hence rendered non-sensitive, or contains special characters
67+ * suggesting nouns within the string do not represent the meaning of the whole string (e.g. a URL or a SQL query).
6768 */
6869 string notSensitive ( ) {
69- result = "(?is).*(redact|censor|obfuscate|hash|md5|sha|((?<!un)(en))?(crypt|code)).*"
70+ result = "(?is).*([^\\w$.-]| redact|censor|obfuscate|hash|md5|sha|((?<!un)(en))?(crypt|code)).*"
7071 }
7172}
7273
Original file line number Diff line number Diff line change @@ -22,3 +22,7 @@ secret;
2222
2323require ( "process" ) . exit ( ) ;
2424global . process . exit ( ) ;
25+
26+ get ( "https://example.com/news?password=true" )
27+ get ( "https://username:password@example.com" )
28+ execute ( "SELECT * FROM users WHERE password=?" )
You can’t perform that action at this time.
0 commit comments