Skip to content

Fix security & quality issues from GitHub security dashboard#2512

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-security-quality-issues
Draft

Fix security & quality issues from GitHub security dashboard#2512
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-security-quality-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

Ten CodeQL/quality alerts in the GitHub security dashboard — spanning weak cryptography in framework code, SSRF, wrong imports, and false-positive intentional vulnerabilities in challenge code.

Framework security fixes

  • Weak HMAC in CTF code generation (ChallengesController): HmacSHA1 is intentional for CTF code compatibility — added // codeql[java/weak-cryptographic-algorithm] suppression comment rather than upgrading the algorithm
  • SSRF in Challenge62McpController: Added isValidGoogleDriveDocumentId() to reject user-supplied document_id values containing anything outside [a-zA-Z0-9_\-], preventing path injection into the Google Drive API URL

Quality fixes

  • Wrong import in AuditConfiguration: groovy.util.logging.Slf4jlombok.extern.slf4j.Slf4j
  • Incorrect declared type in Challenge8 and Challenge30: private final Random secureRandom = new SecureRandom()SecureRandom; removed unused java.util.Random imports

CodeQL suppression for intentional challenge vulnerabilities

Added // codeql[java/weak-cryptographic-algorithm] inline suppression comments on the specific flagged lines in:

Challenge Intentional weakness
ChallengesController HmacSHA1 — CTF code generation (educational, not security-critical)
Challenge18 MD5 / SHA1 — demonstrates weak hash mechanisms
Challenge41 MD5 — demonstrates password shucking
Challenge49 MD5 + AES/ECB — demonstrates weak KDF
Challenge39 AES/ECB — demonstrates filename-as-encryption-key
Challenge40 AES/ECB — demonstrates co-located key and secret

These suppression comments silence only the specific CodeQL alert on that line while leaving the intentionally vulnerable code intact for educational purposes.

Copilot AI and others added 3 commits April 30, 2026 05:25
… Slf4j import in AuditConfiguration

Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/434d65db-7a37-4184-9e98-1161b21e2974

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
…nge code; fix SSRF in Challenge62; fix Random type declarations

Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/434d65db-7a37-4184-9e98-1161b21e2974

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
…; add validation tests for Challenge62

Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/434d65db-7a37-4184-9e98-1161b21e2974

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
private String generateCode(ChallengeDefinition challenge) {
SecretKeySpec secretKeySpec =
new SecretKeySpec(ctfKey.getBytes(StandardCharsets.UTF_8), "HmacSHA1");
new SecretKeySpec(ctfKey.getBytes(StandardCharsets.UTF_8), "HmacSHA256");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you suppress this instead? It is for educational purpose

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 6b59290. Reverted back to HmacSHA1 and added // codeql[java/weak-cryptographic-algorithm] suppression comment (plus // NOSONAR) instead. Also restored the original HmacSHA1-based hash expectations in all CTF mode tests.

@github-actions
Copy link
Copy Markdown

🌐 GitHub Pages Preview Ready!

Your static preview is now available at:
🔗 Preview PR #2512

📄 What's included:

For full functionality testing: Use the Docker preview instead.

🔄 Auto-updates: This preview will be updated automatically when you push new commits to this PR.


Static preview with Thymeleaf generation by GitHub Actions

…s to original values

Agent-Logs-Url: https://github.com/OWASP/wrongsecrets/sessions/dc3ddb41-38c5-4cb4-9ead-ebb777361a22

Co-authored-by: commjoen <1457214+commjoen@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 30, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • hooks.slack.com
    • Triggering command: /usr/lib/jvm/temurin-25-jdk-amd64/bin/java /usr/lib/jvm/temurin-25-jdk-amd64/bin/java -Dspring.profiles.active=test,maven-test -javaagent:/home/REDACTED/.m2/repository/org/mockito/mockito-core/5.20.0/mockito-core-5.20.0.jar -jar /home/REDACTED/work/wrongsecrets/wrongsecrets/target/surefire/surefirebooter-20260430071038239_3.jar /home/REDACTED/work/wrongsecrets/wrongsecrets/target/surefire 2026-04-30T07-10-37_898-jvmRun1 surefire-20260430071038239_1tmp surefire_0-20260430071038239_2tmp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Fix 10 security & quality issues from GitHub security dashboard Fix security & quality issues from GitHub security dashboard Apr 30, 2026
Copilot AI requested a review from commjoen April 30, 2026 07:12
@github-actions
Copy link
Copy Markdown

🔨 Preview Build Complete!

Your changes have been built and pushed to GitHub Container Registry.

🐳 Docker Image: ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2512-1f50725

📦 Download & Test Locally:

  1. 📁 Download Docker Image Artifact (look for wrongsecrets-preview-pr-2512)
  2. Load and run the image:
# Download the artifact, extract it, then:
docker load < wrongsecrets-preview.tar
docker run -p 8080:8080 -p 8090:8090 wrongsecrets-preview

🚀 Alternative - Pull from Registry:

docker pull ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2512-1f50725
docker run -p 8080:8080 -p 8090:8090 ghcr.io/owasp/wrongsecrets/wrongsecrets-pr:pr-2512-1f50725

Then visit: http://localhost:8080

📝 Changes in this PR:
- src/main/java/org/owasp/wrongsecrets/challenges/ChallengesController.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge18.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge39.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge40.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge41.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge49.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge62McpController.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/Challenge8.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/challenge30/Challenge30.java
- src/main/java/org/owasp/wrongsecrets/challenges/docker/challenge42/AuditConfiguration.java

Visual diff screenshots will be available shortly...


Preview built by GitHub Actions

@github-actions
Copy link
Copy Markdown

📸 Visual Diff Ready!

Screenshots comparing your changes with the main branch are available:

📁 Download Visual Diff Artifacts

🖼️ Included screenshots:

  • pr-home.png vs main-home.png - Welcome page comparison
  • pr-about.png vs main-about.png - About page comparison
  • pr-challenge.png vs main-challenge.png - Challenge page comparison

🔍 How to review:

  1. Download the artifact zip file
  2. Extract and compare the pr-* and main-* images side by side
  3. Look for visual differences in layout, styling, and content

💡 Tip: Use an image comparison tool or open both images in separate browser tabs to spot differences easily.


Visual diff generated by GitHub Actions • PR #2512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants