File tree Expand file tree Collapse file tree 12 files changed +89
-26
lines changed Expand file tree Collapse file tree 12 files changed +89
-26
lines changed Original file line number Diff line number Diff line change 194194 </rule >
195195
196196 <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 >
197245</ruleset >
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ jobs:
1313 runs-on : ubuntu-latest
1414 timeout-minutes : 15
1515 steps :
16- - uses : actions/checkout@v4
16+ - uses : actions/checkout@v5
1717
1818 - run : mv .github/.lycheeignore .lycheeignore
1919
2020 - name : Link Checker
2121 id : lychee
22- uses : lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2
22+ uses : lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2
2323 with :
2424 fail : false # Don't fail on broken links, create an issue instead
2525
Original file line number Diff line number Diff line change @@ -30,10 +30,10 @@ jobs:
3030 distribution : [temurin]
3131
3232 steps :
33- - uses : actions/checkout@v4
33+ - uses : actions/checkout@v5
3434
3535 - name : Set up JDK
36- uses : actions/setup-java@v4
36+ uses : actions/setup-java@v5
3737 with :
3838 distribution : ${{ matrix.distribution }}
3939 java-version : ${{ matrix.java }}
@@ -85,10 +85,10 @@ jobs:
8585 distribution : [temurin]
8686
8787 steps :
88- - uses : actions/checkout@v4
88+ - uses : actions/checkout@v5
8989
9090 - name : Set up JDK
91- uses : actions/setup-java@v4
91+ uses : actions/setup-java@v5
9292 with :
9393 distribution : ${{ matrix.distribution }}
9494 java-version : ${{ matrix.java }}
@@ -108,10 +108,10 @@ jobs:
108108 distribution : [temurin]
109109
110110 steps :
111- - uses : actions/checkout@v4
111+ - uses : actions/checkout@v5
112112
113113 - name : Set up JDK
114- uses : actions/setup-java@v4
114+ uses : actions/setup-java@v5
115115 with :
116116 distribution : ${{ matrix.distribution }}
117117 java-version : ${{ matrix.java }}
Original file line number Diff line number Diff line change @@ -35,10 +35,10 @@ jobs:
3535 "$AGENT_TOOLSDIRECTORY" || true
3636 sudo df -h
3737
38- - uses : actions/checkout@v4
38+ - uses : actions/checkout@v5
3939
4040 - name : Set up JDK
41- uses : actions/setup-java@v4
41+ uses : actions/setup-java@v5
4242 with :
4343 distribution : ' temurin'
4444 java-version : 21
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ jobs:
1313 runs-on : ubuntu-latest
1414 timeout-minutes : 30
1515 steps :
16- - uses : actions/checkout@v4
16+ - uses : actions/checkout@v5
1717
1818 - name : Set up JDK
19- uses : actions/setup-java@v4
19+ uses : actions/setup-java@v5
2020 with :
2121 java-version : ' 21'
2222 distribution : ' temurin'
5050 outputs :
5151 upload_url : ${{ steps.create_release.outputs.upload_url }}
5252 steps :
53- - uses : actions/checkout@v4
53+ - uses : actions/checkout@v5
5454
5555 - name : Configure Git
5656 run : |
@@ -103,10 +103,10 @@ jobs:
103103 needs : [prepare_release]
104104 timeout-minutes : 60
105105 steps :
106- - uses : actions/checkout@v4
106+ - uses : actions/checkout@v5
107107
108108 - name : Set up JDK
109- uses : actions/setup-java@v4
109+ uses : actions/setup-java@v5
110110 with :
111111 distribution : ' temurin'
112112 java-version : 21
@@ -137,7 +137,7 @@ jobs:
137137 needs : [publish]
138138 timeout-minutes : 10
139139 steps :
140- - uses : actions/checkout@v4
140+ - uses : actions/checkout@v5
141141
142142 - name : Init Git and pull
143143 run : |
Original file line number Diff line number Diff line change 1616 runs-on : ubuntu-latest
1717 timeout-minutes : 10
1818 steps :
19- - uses : actions/checkout@v4
19+ - uses : actions/checkout@v5
2020 with :
2121 sparse-checkout : .github/labels.yml
2222
Original file line number Diff line number Diff line change 88 runs-on : ubuntu-latest
99 timeout-minutes : 60
1010 steps :
11- - uses : actions/checkout@v4
11+ - uses : actions/checkout@v5
1212
1313 - name : Set up JDK
14- uses : actions/setup-java@v4
14+ uses : actions/setup-java@v5
1515 with :
1616 distribution : ' temurin'
1717 java-version : 21
Original file line number Diff line number Diff line change 3636 update_branch_merged_commit : ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
3737 create_update_branch_merged_pr : ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
3838 steps :
39- - uses : actions/checkout@v4
39+ - uses : actions/checkout@v5
4040 with :
4141 # Required because otherwise there are always changes detected when executing diff/rev-list
4242 fetch-depth : 0
@@ -183,7 +183,7 @@ jobs:
183183 runs-on : ubuntu-latest
184184 timeout-minutes : 60
185185 steps :
186- - uses : actions/checkout@v4
186+ - uses : actions/checkout@v5
187187 with :
188188 # Required because otherwise there are always changes detected when executing diff/rev-list
189189 fetch-depth : 0
Original file line number Diff line number Diff line change 88out
99classes
1010
11- # Vim
12- * .swp
13-
1411# Plugins
1512* .idea /checkstyle-idea.xml
1613
2926! .idea /saveactions_settings.xml
3027! .idea /checkstyle-idea.xml
3128! .idea /externalDependencies.xml
29+ ! .idea /PMDPlugin.xml
3230
3331! .idea /inspectionProfiles /
3432.idea /inspectionProfiles /*
You can’t perform that action at this time.
0 commit comments