Skip to content

Fix clickjacking level 1 framing protection - #220

Open
r1kka6 wants to merge 1 commit into
OWASP-CTF:dc34-ctffrom
r1kka6:fix/clickjacking-level-1
Open

r1kka6 wants to merge 1 commit into
OWASP-CTF:dc34-ctffrom
r1kka6:fix/clickjacking-level-1

Conversation

@r1kka6

@r1kka6 r1kka6 commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • add a Content-Security-Policy: frame-ancestors 'none' response header to ClickjackingVulnerability LEVEL_1
  • update the focused unit test so LEVEL_1 is treated as protected while the remaining vulnerable levels stay unchanged

Reproduction

Before the patch, GET /VulnerableApp/ClickjackingVulnerability/LEVEL_1 returned 200 without X-Frame-Options or Content-Security-Policy, allowing arbitrary framing.

After the patch, the same request returns Content-Security-Policy: frame-ancestors 'none'.

Verification

  • docker run --rm -v "$PWD":/workspace -v "$HOME/.gradle":/root/.gradle -w /workspace eclipse-temurin:17-jdk ./gradlew test --tests org.sasanlabs.service.vulnerability.clickjacking.ClickjackingVulnerabilityTest --no-daemon
  • docker run --rm -v "$PWD":/workspace -v "$HOME/.gradle":/root/.gradle -w /workspace eclipse-temurin:17-jdk ./gradlew test --no-daemon
  • docker run --rm -v "$PWD":/workspace -v "$HOME/.gradle":/root/.gradle -w /workspace eclipse-temurin:17-jdk ./gradlew spotlessJavaCheck --no-daemon
  • runtime check on port 9093 confirmed LEVEL_1 now returns Content-Security-Policy: frame-ancestors 'none'

Signed-off-by: snow <snow@snows-MacBook-Pro-2.local>
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.

1 participant