File tree Expand file tree Collapse file tree 5 files changed +47
-9
lines changed
test/query-tests/Security/CWE-571 Expand file tree Collapse file tree 5 files changed +47
-9
lines changed Original file line number Diff line number Diff line change 22library : true
33warnOnImplicitThis : true
44name : githubsecuritylab/actions-all
5- version : 0.0.13
5+ version : 0.0.14
66dependencies :
77 codeql/util : ^0.2.0
88 codeql/yaml : ^0.1.2
Original file line number Diff line number Diff line change 11/**
2+ *:
3+ *
24 * @name If expression always true
35 * @description Expressions used in If conditions with extra spaces are always true.
46 * @kind problem
@@ -16,10 +18,10 @@ import actions
1618from If i
1719where
1820 i .getCondition ( ) .matches ( "%${{%" ) and
19- i . getConditionStyle ( ) = [ "|" , ">" ]
20- or
21- i .getCondition ( ) .matches ( "%${{%" ) and
22- not i . getCondition ( ) . matches ( "${{%" )
21+ (
22+ not i . getCondition ( ) . matches ( "${{%" ) or
23+ not i .getCondition ( ) .matches ( "%}}" )
24+ )
2325 or
2426 count ( i .getCondition ( ) .splitAt ( "${{" ) ) > 2
2527select i , "Expression always evaluates to true"
Original file line number Diff line number Diff line change 11---
22library : false
33name : githubsecuritylab/actions-queries
4- version : 0.0.13
4+ version : 0.0.14
55groups :
66 - actions
77 - queries
Original file line number Diff line number Diff line change 88 process-pr :
99 runs-on : ubuntu-latest
1010 steps :
11- - name : Test1
11+ - name : Test 1
1212 if : 1 == 2
1313 run : echo "Test 1 should not be printed"
1414 - name : Test 2
3636 - name : Test 7
3737 run : echo "Test 7 should not be printed"
3838 if : ${{
39- 1 == 2 ||
40- 3 == 4
39+ github.actor == 'torvalds' ||
40+ github.actor == 'dependabot[bot]'
4141 }}
4242
4343 - name : Test 8
5858 - name : Test 12
5959 if : " ${{ 1 == 2 }}"
6060 run : echo "Test 12 should not be printed"
61+ - name : Test 13
62+ if : |
63+ 1 == 2 ||
64+ 3 == 4
65+ run : echo "Test 13 should not be printed"
66+ - name : Test 14
67+ if : >-
68+ ${{(
69+ false || 1 == 2
70+ )}}
71+ run : echo "Test 14 should not be printed"
72+ - name : Test 15
73+ if : |-
74+ ${{(
75+ false || 1 == 2
76+ )}}
77+ run : echo "Test 15 should not be printed"
78+ - name : Test 16
79+ if : |+
80+ ${{(
81+ false || 1 == 2
82+ )}}
83+ run : echo "Test 16 should not be printed"
84+ - name : Test 17
85+ if : >+
86+ ${{(
87+ false || 1 == 2
88+ )}}
89+ run : echo "Test 17 should not be printed"
Original file line number Diff line number Diff line change 1+ | .github/workflows/test.yml:15:13:19:13 | \| | Expression always evaluates to true |
2+ | .github/workflows/test.yml:34:13:34:39 | ${{ 1 = ... == 2 }} | Expression always evaluates to true |
3+ | .github/workflows/test.yml:45:13:48:24 | > | Expression always evaluates to true |
4+ | .github/workflows/test.yml:56:15:56:31 | " ${{ 1 == 2 }}" | Expression always evaluates to true |
5+ | .github/workflows/test.yml:59:15:59:31 | " ${{ 1 == 2 }}" | Expression always evaluates to true |
6+ | .github/workflows/test.yml:79:13:82:14 | \|+ | Expression always evaluates to true |
7+ | .github/workflows/test.yml:85:13:88:14 | >+ | Expression always evaluates to true |
You can’t perform that action at this time.
0 commit comments