File tree Expand file tree Collapse file tree 3 files changed +11
-18
lines changed
powershell/ql/src/experimental Expand file tree Collapse file tree 3 files changed +11
-18
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* @name Hardcoded Computer Name
3
- * @description Using externally controlled strings in a command line may allow a malicious
4
- * user to change the meaning of the command.
3
+ * @description Do not hardcode computer names in powershell scripts.
5
4
* @kind problem
6
5
* @problem.severity error
7
- * @security-severity 9.8
6
+ * @security-severity 7.0
8
7
* @precision high
9
- * @id powershell/microsoft/public/command-injection
8
+ * @id powershell/microsoft/public/hardcoded-computer-name
10
9
* @tags correctness
11
10
* security
12
11
* external/cwe/cwe-078
Original file line number Diff line number Diff line change 1
1
/**
2
- * @name Hardcoded Computer Name
3
- * @description Using externally controlled strings in a command line may allow a malicious
4
- * user to change the meaning of the command.
2
+ * @name Reserved Characters in Function Name
3
+ * @description Do not use reserved characters in function names
5
4
* @kind problem
6
5
* @problem.severity error
7
- * @security-severity 9.8
6
+ * @security-severity 7.0
8
7
* @precision high
9
- * @id powershell/microsoft/public/command-injection
8
+ * @id powershell/microsoft/public/reserved-characters-in-function-name
10
9
* @tags correctness
11
10
* security
12
11
* external/cwe/cwe-078
Original file line number Diff line number Diff line change 1
1
/**
2
- * @name Hardcoded Computer Name
3
- * @description Using externally controlled strings in a command line may allow a malicious
4
- * user to change the meaning of the command.
2
+ * @name Use of Username or Password parameter
3
+ * @description Do not use username or password parameters
5
4
* @kind problem
6
5
* @problem.severity error
7
- * @security-severity 9.8
6
+ * @security-severity 7.0
8
7
* @precision high
9
- * @id powershell/microsoft/public/command-injection
8
+ * @id powershell/microsoft/public/username-or-password-parameter
10
9
* @tags correctness
11
10
* security
12
11
* external/cwe/cwe-078
15
14
16
15
import powershell
17
16
18
- // from Expr e
19
- // where e.getLocation().getFile().getBaseName() = "AvoidUsingUsernameAndPasswordParams.ps1"
20
- // select e, e.getAQlClass()
21
-
22
17
from Parameter p
23
18
where p .getName ( ) .toLowerCase ( ) = [ "username" , "password" ]
24
19
select p , "Do not use username or password parameters."
You can’t perform that action at this time.
0 commit comments