Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .config/pmd/java/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,52 @@
</rule>

<rule ref="category/java/security.xml"/>

<rule name="AvoidSystemSetterCall"
language="java"
message="Setters of java.lang.System should not be called unless really needed"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule">
<description>
Calling setters of java.lang.System usually indicates bad design and likely causes unexpected behavior.
For example, it may break when multiple Threads are setting the value.
It may also overwrite user defined options or properties.

Try to pass the value only to the place where it's really needed and use it there accordingly.
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//MethodCall[starts-with(@MethodName,'set')]/TypeExpression[pmd-java:typeIsExactly('java.lang.System')]
]]>
</value>
</property>
</properties>
</rule>

<rule name="JavaObjectSerializationIsUnsafe"
language="java"
message="Using Java Object (De-)Serialization is unsafe and has led to too many security vulnerabilities"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule">
<description>
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).
Vulnerabilities are so common that there are [dedicated projects for exploit payload generation](https://github.com/frohoff/ysoserial).

Java Object Serialization may also fail to deserialize when the underlying classes are changed.

Use proven data interchange formats like JSON instead.
</description>
<priority>2</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//ClassDeclaration[@Interface = false()]/ClassBody/FieldDeclaration/VariableDeclarator/VariableId[@Name='serialVersionUID'] |
//ConstructorCall/ClassType[pmd-java:typeIsExactly('java.io.ObjectInputStream') or pmd-java:typeIsExactly('java.io.ObjectOutputStream')]
]]>
</value>
</property>
</properties>
</rule>
</ruleset>
2 changes: 1 addition & 1 deletion .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- run: mv .github/.lycheeignore .lycheeignore

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
distribution: [temurin]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up JDK
uses: actions/setup-java@v4
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
distribution: [temurin]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up JDK
uses: actions/setup-java@v4
Expand All @@ -97,7 +97,7 @@ jobs:
distribution: [temurin]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up JDK
uses: actions/setup-java@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up JDK
uses: actions/setup-java@v4
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Configure Git
run: |
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
needs: [prepare-release]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Init Git and pull
run: |
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
needs: [prepare-release]
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Init Git and pull
run: |
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
needs: [publish-maven]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Init Git and pull
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
sparse-checkout: .github/labels.yml

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up JDK
uses: actions/setup-java@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-from-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Required because otherwise there are always changes detected when executing diff/rev-list
fetch-depth: 0
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# Required because otherwise there are always changes detected when executing diff/rev-list
fetch-depth: 0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ hs_err_pid*
!.idea/saveactions_settings.xml
!.idea/checkstyle-idea.xml
!.idea/externalDependencies.xml
!.idea/PMDPlugin.xml

!.idea/inspectionProfiles/
.idea/inspectionProfiles/*
Expand Down
16 changes: 16 additions & 0 deletions .idea/PMDPlugin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/saveactions_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading