File tree Expand file tree Collapse file tree 10 files changed +79
-13
lines changed Expand file tree Collapse file tree 10 files changed +79
-13
lines changed Original file line number Diff line number Diff line change 194
194
</rule >
195
195
196
196
<rule ref =" category/java/security.xml" />
197
+
198
+ <rule name =" AvoidSystemSetterCall"
199
+ language =" java"
200
+ message =" Setters of java.lang.System should not be called unless really needed"
201
+ class =" net.sourceforge.pmd.lang.rule.xpath.XPathRule" >
202
+ <description >
203
+ Calling setters of java.lang.System usually indicates bad design and likely causes unexpected behavior.
204
+ For example, it may break when multiple Threads are setting the value.
205
+ It may also overwrite user defined options or properties.
206
+
207
+ Try to pass the value only to the place where it's really needed and use it there accordingly.
208
+ </description >
209
+ <priority >3</priority >
210
+ <properties >
211
+ <property name =" xpath" >
212
+ <value >
213
+ <![CDATA[
214
+ //MethodCall[starts-with(@MethodName,'set')]/TypeExpression[pmd-java:typeIsExactly('java.lang.System')]
215
+ ]]>
216
+ </value >
217
+ </property >
218
+ </properties >
219
+ </rule >
220
+
221
+ <rule name =" JavaObjectSerializationIsUnsafe"
222
+ language =" java"
223
+ message =" Using Java Object (De-)Serialization is unsafe and has led to too many security vulnerabilities"
224
+ class =" net.sourceforge.pmd.lang.rule.xpath.XPathRule" >
225
+ <description >
226
+ Nearly every known usage of (Java) Object Deserialization has resulted in [a security vulnerability](https://cloud.google.com/blog/topics/threat-intelligence/hunting-deserialization-exploits?hl=en).
227
+ Vulnerabilities are so common that there are [dedicated projects for exploit payload generation](https://github.com/frohoff/ysoserial).
228
+
229
+ Java Object Serialization may also fail to deserialize when the underlying classes are changed.
230
+
231
+ Use proven data interchange formats like JSON instead.
232
+ </description >
233
+ <priority >2</priority >
234
+ <properties >
235
+ <property name =" xpath" >
236
+ <value >
237
+ <![CDATA[
238
+ //ClassDeclaration[@Interface = false()]/ClassBody/FieldDeclaration/VariableDeclarator/VariableId[@Name='serialVersionUID'] |
239
+ //ConstructorCall/ClassType[pmd-java:typeIsExactly('java.io.ObjectInputStream') or pmd-java:typeIsExactly('java.io.ObjectOutputStream')]
240
+ ]]>
241
+ </value >
242
+ </property >
243
+ </properties >
244
+ </rule >
197
245
</ruleset >
Original file line number Diff line number Diff line change 13
13
runs-on : ubuntu-latest
14
14
timeout-minutes : 15
15
15
steps :
16
- - uses : actions/checkout@v4
16
+ - uses : actions/checkout@v5
17
17
18
18
- run : mv .github/.lycheeignore .lycheeignore
19
19
Original file line number Diff line number Diff line change 33
33
distribution : [temurin]
34
34
35
35
steps :
36
- - uses : actions/checkout@v4
36
+ - uses : actions/checkout@v5
37
37
38
38
- name : Set up JDK
39
39
uses : actions/setup-java@v4
81
81
distribution : [temurin]
82
82
83
83
steps :
84
- - uses : actions/checkout@v4
84
+ - uses : actions/checkout@v5
85
85
86
86
- name : Set up JDK
87
87
uses : actions/setup-java@v4
@@ -104,7 +104,7 @@ jobs:
104
104
distribution : [temurin]
105
105
106
106
steps :
107
- - uses : actions/checkout@v4
107
+ - uses : actions/checkout@v5
108
108
109
109
- name : Set up JDK
110
110
uses : actions/setup-java@v4
Original file line number Diff line number Diff line change 16
16
runs-on : ubuntu-latest
17
17
timeout-minutes : 30
18
18
steps :
19
- - uses : actions/checkout@v4
19
+ - uses : actions/checkout@v5
20
20
21
21
- name : Set up JDK
22
22
uses : actions/setup-java@v4
53
53
outputs :
54
54
upload_url : ${{ steps.create-release.outputs.upload_url }}
55
55
steps :
56
- - uses : actions/checkout@v4
56
+ - uses : actions/checkout@v5
57
57
58
58
- name : Configure Git
59
59
run : |
@@ -105,7 +105,7 @@ jobs:
105
105
needs : [prepare-release]
106
106
timeout-minutes : 60
107
107
steps :
108
- - uses : actions/checkout@v4
108
+ - uses : actions/checkout@v5
109
109
110
110
- name : Init Git and pull
111
111
run : |
@@ -153,7 +153,7 @@ jobs:
153
153
needs : [prepare-release]
154
154
timeout-minutes : 15
155
155
steps :
156
- - uses : actions/checkout@v4
156
+ - uses : actions/checkout@v5
157
157
158
158
- name : Init Git and pull
159
159
run : |
@@ -184,7 +184,7 @@ jobs:
184
184
needs : [publish-maven]
185
185
timeout-minutes : 10
186
186
steps :
187
- - uses : actions/checkout@v4
187
+ - uses : actions/checkout@v5
188
188
189
189
- name : Init Git and pull
190
190
run : |
Original file line number Diff line number Diff line change 16
16
runs-on : ubuntu-latest
17
17
timeout-minutes : 10
18
18
steps :
19
- - uses : actions/checkout@v4
19
+ - uses : actions/checkout@v5
20
20
with :
21
21
sparse-checkout : .github/labels.yml
22
22
Original file line number Diff line number Diff line change 11
11
runs-on : ubuntu-latest
12
12
timeout-minutes : 60
13
13
steps :
14
- - uses : actions/checkout@v4
14
+ - uses : actions/checkout@v5
15
15
16
16
- name : Set up JDK
17
17
uses : actions/setup-java@v4
Original file line number Diff line number Diff line change 36
36
update_branch_merged_commit : ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
37
37
create_update_branch_merged_pr : ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
38
38
steps :
39
- - uses : actions/checkout@v4
39
+ - uses : actions/checkout@v5
40
40
with :
41
41
# Required because otherwise there are always changes detected when executing diff/rev-list
42
42
fetch-depth : 0
@@ -183,7 +183,7 @@ jobs:
183
183
runs-on : ubuntu-latest
184
184
timeout-minutes : 60
185
185
steps :
186
- - uses : actions/checkout@v4
186
+ - uses : actions/checkout@v5
187
187
with :
188
188
# Required because otherwise there are always changes detected when executing diff/rev-list
189
189
fetch-depth : 0
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ hs_err_pid*
44
44
! .idea /saveactions_settings.xml
45
45
! .idea /checkstyle-idea.xml
46
46
! .idea /externalDependencies.xml
47
+ ! .idea /PMDPlugin.xml
47
48
48
49
! .idea /inspectionProfiles /
49
50
.idea /inspectionProfiles /*
You can’t perform that action at this time.
0 commit comments