diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 696cb3a7f4..3b2f9aae32 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1 +1 @@
-custom: https://owasp.org/donate/?reponame=www-project-webgoat&title=OWASP+WebGoat
\ No newline at end of file
+custom: https://owasp.org/donate/?reponame=www-project-webgoat&title=OWASP+WebGoat
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 28d0b0bc6d..f2ea9477f6 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -12,4 +12,3 @@ updates:
directory: "/"
schedule:
interval: "weekly"
-
diff --git a/.github/workflows/branchbuild.txt b/.github/workflows/branchbuild.txt
index 33ced2de96..95a45a1f04 100644
--- a/.github/workflows/branchbuild.txt
+++ b/.github/workflows/branchbuild.txt
@@ -11,9 +11,9 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
- java-version: [ 17, 21 ]
+ java-version: [ 21 ]
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
@@ -51,4 +51,4 @@ jobs:
file: ./Dockerfile_desktop
push: false
build-args: |
- webgoat_version=${{ env.WEBGOAT_MAVEN_VERSION }}
+ webgoat_version=${{ env.WEBGOAT_MAVEN_VERSION }}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 121940fee5..0caa5a2920 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,34 +1,51 @@
-name: "Pull requests build"
+name: "Main / Pull requests build"
on:
pull_request:
paths-ignore:
- '.txt'
- 'LICENSE'
- 'docs/**'
- branches: [main]
+ branches: [ main ]
push:
branches:
- main
jobs:
+ pre-commit:
+ name: Pre-commit check
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout git repository
+ uses: actions/checkout@v4.1.6
+ - name: Setup python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.9"
+ - uses: actions/setup-java@v4
+ with:
+ distribution: 'temurin'
+ java-version: '23'
+ - name: Pre-commit checks
+ uses: pre-commit/action@v3.0.1
+ - name: pre-commit-c-lite
+ uses: pre-commit-ci/lite-action@v1.1.0
+ if: always()
build:
runs-on: ${{ matrix.os }}
+ needs: [ pre-commit ]
strategy:
+ fail-fast: true
matrix:
- os: [ ubuntu-latest, windows-latest, macos-latest ]
+ os: [ windows-latest, ubuntu-latest, macos-13 ]
+ max-parallel: 1
steps:
- - uses: actions/checkout@v3
- - name: Set up JDK 17
- uses: actions/setup-java@v4
+ - uses: actions/checkout@v4.1.6
+ - name: Set up JDK 23
+ uses: actions/setup-java@v4.2.1
with:
distribution: 'temurin'
- java-version: 17
+ java-version: 23
architecture: x64
- - name: Cache Maven packages
- uses: actions/cache@v3.3.1
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
+ cache: 'maven'
- name: Build with Maven
run: mvn --no-transfer-progress verify
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index cc87c2e81a..7fff20169a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -13,21 +13,15 @@ jobs:
environment:
name: release
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- - name: Set up JDK 17
+ - name: Set up JDK 23
uses: actions/setup-java@v4
with:
distribution: 'temurin'
- java-version: 17
+ java-version: 23
architecture: x64
-
- - name: Cache Maven packages
- uses: actions/cache@v3.3.1
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2
+ cache: 'maven'
- name: "Set labels for ${{ github.ref }}"
run: |
@@ -46,7 +40,7 @@ jobs:
files: |
target/webgoat-${{ env.WEBGOAT_MAVEN_VERSION }}.jar
body: |
- ## Version ${{ github.ref_name }}
+ ## Version ${{ github.ref_name }}
### New functionality
@@ -55,8 +49,8 @@ jobs:
### Bug fixes
- [#743 - Character encoding errors](https://github.com/WebGoat/WebGoat/issues/743)
-
- Full change log: https://github.com/WebGoat/WebGoat/compare/${{ github.ref_name }}...${{ github.ref_name }}
+
+ Full change log: https://github.com/WebGoat/WebGoat/compare/${{ github.ref_name }}...${{ github.ref_name }}
## Contributors
@@ -74,7 +68,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Set up QEMU"
- uses: docker/setup-qemu-action@v2.2.0
+ uses: docker/setup-qemu-action@v3.3.0
with:
platforms: all
@@ -82,13 +76,13 @@ jobs:
uses: docker/setup-buildx-action@v3
- name: "Login to dockerhub"
- uses: docker/login-action@v3.0.0
+ uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Build and push WebGoat"
- uses: docker/build-push-action@v5.1.0
+ uses: docker/build-push-action@v6.11.0
with:
context: ./
file: ./Dockerfile
@@ -101,7 +95,7 @@ jobs:
webgoat_version=${{ env.WEBGOAT_MAVEN_VERSION }}
- name: "Build and push WebGoat desktop"
- uses: docker/build-push-action@v5.1.0
+ uses: docker/build-push-action@v6.11.0
with:
context: ./
file: ./Dockerfile_desktop
@@ -118,15 +112,15 @@ jobs:
needs: [ release ]
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
- - name: Set up JDK 17
+ - name: Set up JDK 23
uses: actions/setup-java@v4
with:
distribution: 'temurin'
- java-version: 17
+ java-version: 23
architecture: x64
- name: Set version to next snapshot
@@ -147,4 +141,3 @@ jobs:
github_token: "${{ secrets.GITHUB_TOKEN }}"
title: ${{ github.event.commits[0].message }}
target_branch: main
-
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index ab517903d7..f6ea94ad6a 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -21,27 +21,21 @@ jobs:
name: "Robot framework test"
steps:
# Uses an default action to checkout the code
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4.1.6
# Uses an action to add Python to the VM
- name: Setup Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: '3.7'
architecture: x64
- # Uses an action to add JDK 17 to the VM (and mvn?)
- - name: set up JDK 17
- uses: actions/setup-java@v4
+ # Uses an action to add JDK 23 to the VM (and mvn?)
+ - name: set up JDK 23
+ uses: actions/setup-java@v4.2.1
with:
distribution: 'temurin'
- java-version: 17
+ java-version: 23
architecture: x64
- #Uses an action to set up a cache using a certain key based on the hash of the dependencies
- - name: Cache Maven packages
- uses: actions/cache@v3.3.1
- with:
- path: ~/.m2
- key: ubuntu-latest-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ubuntu-latest-m2-
+ cache: 'maven'
- uses: BSFishy/pip-action@v1
with:
packages: |
diff --git a/.gitignore b/.gitignore
index f914d3ab7f..06de08b13d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,4 +56,4 @@ TestClass.class
**/*.flattened-pom.xml
/.gitconfig
-webgoat.gitconfig
\ No newline at end of file
+webgoat.gitconfig
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000000..b49ff10dc9
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,28 @@
+ci:
+ autofix_commit_msg: |
+ [pre-commit.ci] auto fixes from pre-commit.com hooks
+ autofix_prs: false # managed in the action step
+ autoupdate_branch: ""
+ autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
+ autoupdate_schedule: weekly
+ skip: []
+ submodules: false
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.4.0
+ hooks:
+ - id: check-yaml
+ - id: end-of-file-fixer
+ exclude: ^(README.md|CREATE_RELEASE.md)
+ - id: trailing-whitespace
+ - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
+ rev: v9.5.0
+ hooks:
+ - id: commitlint
+ stages: [commit-msg]
+ - repo: https://github.com/ejba/pre-commit-maven
+ rev: v0.3.4
+ hooks:
+ - id: maven
+ args: [ 'clean compile' ]
+ - id: maven-spotless-apply
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt
index bed6f51c05..2e72cb505d 100644
--- a/COPYRIGHT.txt
+++ b/COPYRIGHT.txt
@@ -16,4 +16,4 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, B
Getting Source ==============
-Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
\ No newline at end of file
+Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
diff --git a/CREATE_RELEASE.md b/CREATE_RELEASE.md
index fa1244b370..fc22906f04 100644
--- a/CREATE_RELEASE.md
+++ b/CREATE_RELEASE.md
@@ -11,11 +11,11 @@ Update the release notes with the correct version. Use `git shortlog -s -n --sin
committers. In order to fetch the list of issues included use: `git log --graph --pretty='%C(auto)%d%Creset%s' v2023.4..origin/main`
```
-mvn versions:set
+mvn versions:set
<< update release notes >>
mvn verify
git commit ....
-git tag v2023.01
+git tag v2023.01
git push --tags
```
diff --git a/Dockerfile b/Dockerfile
index 51bbcb1c16..c110ae3c21 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,8 @@
-FROM docker.io/eclipse-temurin:21.0.1_12-jre
-LABEL NAME = "WebGoat: A deliberately insecure Web Application"
-MAINTAINER "WebGoat team"
+# We need JDK as some of the lessons needs to be able to compile Java code
+FROM docker.io/eclipse-temurin:23-jdk-noble
+
+LABEL name="WebGoat: A deliberately insecure Web Application"
+LABEL maintainer="WebGoat team"
RUN \
useradd -ms /bin/bash webgoat && \
@@ -33,3 +35,6 @@ ENTRYPOINT [ "java", \
"--add-opens", "java.base/java.io=ALL-UNNAMED", \
"-Drunning.in.docker=true", \
"-jar", "webgoat.jar", "--server.address", "0.0.0.0" ]
+
+HEALTHCHECK --interval=5s --timeout=3s \
+ CMD curl --fail http://localhost:8080/WebGoat/actuator/health || exit 1
diff --git a/Dockerfile_desktop b/Dockerfile_desktop
index e6dbd15cb3..7bee56d038 100644
--- a/Dockerfile_desktop
+++ b/Dockerfile_desktop
@@ -1,6 +1,6 @@
FROM lscr.io/linuxserver/webtop:ubuntu-xfce
-LABEL NAME = "WebGoat: A deliberately insecure Web Application"
-MAINTAINER "WebGoat team"
+LABEL name="WebGoat: A deliberately insecure Web Application"
+LABEL maintainer="WebGoat team"
WORKDIR /config
@@ -9,26 +9,39 @@ COPY config/desktop/start_webgoat.sh /config/start_webgoat.sh
COPY config/desktop/start_zap.sh /config/start_zap.sh
COPY config/desktop/WebGoat.txt /config/Desktop/
+RUN \
+ apt-get update && \
+ apt-get --yes install vim nano gzip
+
+RUN \
+ case $(uname -m) in \
+ x86_64) ARCH=x64;; \
+ aarch64) ARCH=aarch64;; \
+ *) ARCH=unknown;; \
+ esac && \
+ echo ${ARCH}
+
+RUN \
+ curl -LO https://github.com/zaproxy/zaproxy/releases/download/v2.15.0/ZAP_2.15.0_Linux.tar.gz && \
+ tar zfxv ZAP_2.15.0_Linux.tar.gz && \
+ rm -rf ZAP_2.15.0_Linux.tar.gz
+
RUN \
case $(uname -m) in \
x86_64) ARCH=x64;; \
aarch64) ARCH=aarch64;; \
*) ARCH=unknown;; \
esac && \
- curl -LO https://github.com/zaproxy/zaproxy/releases/download/v2.12.0/ZAP_2.12.0_Linux.tar.gz && \
- tar zfxv ZAP_2.12.0_Linux.tar.gz && \
- rm -rf ZAP_2.12.0_Linux.tar.gz && \
- curl -LO https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jre_${ARCH}_linux_hotspot_17.0.6_10.tar.gz && \
- tar zfxv OpenJDK17U-jre_${ARCH}_linux_hotspot_17.0.6_10.tar.gz && \
- rm -rf OpenJDK17U-jre_${ARCH}_linux_hotspot_17.0.6_10.tar.gz && \
+ echo "oeps == ${ARCH}==" && \
+ curl -L https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.1%2B11/OpenJDK23U-jre_"${ARCH}"_linux_hotspot_23.0.1_11.tar.gz -o java.tar.gz && \
+ tar zfxv java.tar.gz && \
+ rm -rf java.tar.gz && \
chmod +x /config/start_webgoat.sh && \
chmod +x /config/start_zap.sh && \
- apt-get update && \
- apt-get --yes install vim nano && \
- echo "JAVA_HOME=/config/jdk-17.0.6+10-jre/" >> .bash_aliases && \
+ mv /config/jdk-23.0.1+11-jre /config/java-jdk && \
+ echo "JAVA_HOME=/config/java-jdk/" >> .bash_aliases && \
echo "PATH=$PATH:$JAVA_HOME/bin" >> .bash_aliases
-
-ENV JAVA_HOME=/home/webgoat/jdk-17.0.6+10-jre
+ENV JAVA_HOME=/config/java-jdk
WORKDIR /config/Desktop
diff --git a/FAQ.md b/FAQ.md
index 3e2968344f..db652e04ff 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -5,4 +5,3 @@
### Integration tests fail
Try to run the command in the console `java -jar ...` and remove `-Dlogging.pattern.console=` from the command line.
-
diff --git a/LICENSE.txt b/LICENSE.txt
index 573d2b4ebd..cb10f880d0 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -16,4 +16,4 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, B
Getting Source ==============
-Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
\ No newline at end of file
+Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software projects.
diff --git a/README.md b/README.md
index b8203e0bd7..3efa8e7ac8 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# WebGoat: A deliberately insecure Web Application
[![Build](https://github.com/WebGoat/WebGoat/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/WebGoat/WebGoat/actions/workflows/build.yml)
-[![java-jdk](https://img.shields.io/badge/java%20jdk-17-green.svg)](https://jdk.java.net/)
+[![java-jdk](https://img.shields.io/badge/java%20jdk-23-green.svg)](https://jdk.java.net/)
[![OWASP Labs](https://img.shields.io/badge/OWASP-Lab%20project-f7b73c.svg)](https://owasp.org/projects/)
[![GitHub release](https://img.shields.io/github/release/WebGoat/WebGoat.svg)](https://github.com/WebGoat/WebGoat/releases/latest)
[![Gitter](https://badges.gitter.im/OWASPWebGoat/community.svg)](https://gitter.im/OWASPWebGoat/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
@@ -80,11 +80,21 @@ Download the latest WebGoat release from [https://github.com/WebGoat/WebGoat/rel
```shell
export TZ=Europe/Amsterdam # or your timezone
-java -Dfile.encoding=UTF-8 -jar webgoat-2023.5.jar
+java -Dfile.encoding=UTF-8 -jar webgoat-2023.8.jar
```
Click the link in the log to start WebGoat.
+### 3.1 Running on a different port
+
+If for some reason you want to run WebGoat on a different port, you can do so by adding the following parameter:
+
+```shell
+java -jar webgoat-2023.8.jar --webgoat.port=8001 --webwolf.port=8002
+```
+
+For a full overview of all the parameters you can use, please check the [WebGoat properties file](webgoat-container/src/main/resources/application-{webgoat, webwolf}.properties).
+
## 4. Run from the sources
### Prerequisites:
@@ -144,7 +154,7 @@ For instance running as a jar on a Linux/macOS it will look like this:
export TZ=Europe/Amsterdam # or your timezone
export EXCLUDE_CATEGORIES="CLIENT_SIDE,GENERAL,CHALLENGE"
export EXCLUDE_LESSONS="SqlInjectionAdvanced,SqlInjectionMitigations"
-java -jar target/webgoat-2023.6-SNAPSHOT.jar
+java -jar target/webgoat-2023.8-SNAPSHOT.jar
```
Or in a docker run it would (once this version is pushed into docker hub) look like this:
diff --git a/README_I18N.md b/README_I18N.md
index 6a4769f1e8..1286421c44 100644
--- a/README_I18N.md
+++ b/README_I18N.md
@@ -16,19 +16,19 @@ The following steps are required when you want to add a new language
1. Update [main_new.html](src/main/resources/webgoat/static/main_new.html)
1. Add the parts for showing the flag and providing the correct value for the flag= parameter
-2.
-3. Add a flag image to src/main/resources/webgoat/static/css/img
+ 2.
+2. Add a flag image to src/main/resources/webgoat/static/css/img
1. See the main_new.html for a link to download flag resources
-4. Add a welcome page to the introduction lesson
+3. Add a welcome page to the introduction lesson
1. Copy Introduction_.adoc to Introduction_es.adoc (if in this case you want to add Spanish)
2. Add a highlighted section that explains that most parts of WebGoat will still be in English and invite people to translate parts where it would be valuable
-5. Translate the main labels
+4. Translate the main labels
1. Copy messages.properties to messages_es.properties (if in this case you want to add Spanish)
2. Translate the label values
-6. Optionally translate lessons by
+5. Optionally translate lessons by
1. Adding lang specifc adoc files in documentation folder of the lesson
2. Adding WebGoatLabels.properties of a specific language if you want to
-7. Run mvn clean to see if the LabelAndHintIntegration test passes
-8. Run WebGoat and verify that your own language and the other languages work as expected
+6. Run mvn clean to see if the LabelAndHintIntegration test passes
+7. Run WebGoat and verify that your own language and the other languages work as expected
If you only want to translate more for a certain language, you only need to do step 4-8
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 0c29bfccb5..6a2842d6e7 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -215,4 +215,3 @@ Special thanks to the following contributors providing us with a pull request:
And everyone who provided feedback through Github.
Team WebGoat
-
diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml
index 6ce36f4e11..6ad83bb0f6 100644
--- a/config/checkstyle/suppressions.xml
+++ b/config/checkstyle/suppressions.xml
@@ -8,4 +8,4 @@