Skip to content

feat: add challenge 79 with forkable encrypted GitHub Actions secret - #2810

Open
prx-my wants to merge 4 commits into
OWASP:masterfrom
prx-my:feat/challenge-77-forkable-actions-secret
Open

prx-my wants to merge 4 commits into
OWASP:masterfrom
prx-my:feat/challenge-77-forkable-actions-secret

Conversation

@prx-my

@prx-my prx-my commented Nov 22, 2026 •

Copy link
Copy Markdown

What

Adds Challenge 79: The Forkable GitHub Actions Secret (closes #425).

GitHub does not copy repository secrets to forks. Following the suggestion in #425
("an encrypted secret in a github action with the key embedded into it"), the workflow
.github/workflows/challenge79.yml ships the secret AES-256-CTR encrypted and keeps the
key and IV in the same file. Anyone who forks the repo can run the workflow (or plain
openssl) and read the secret.

Changes

  • .github/workflows/challenge79.yml: workflow_dispatch only, contents: read, no third-party actions
  • Challenge79.java: FixedAnswerChallenge that decrypts the same ciphertext with the JDK's AES-CTR
  • Explanation, hint and reason in en, nl, de, es, fr, uk
  • Registered in wrong-secrets-configuration.yaml (CI/CD, easy, CTF enabled)
  • Challenge79Test, including a check that the Java constants match the workflow
  • Localization coverage counts bumped from 76/251 to 77/254; README link added

AES-CTR instead of CBC: CodeQL flags AES/CBC/PKCS5Padding (padding oracle), CTR has no
padding, is supported by openssl enc, and passes CodeQL. SpotBugs CIPHER_INTEGRITY is
suppressed with a justification, as in challenges 54 and 63.

Testing

  • Challenge79Test, ChallengeContentLocalizationCoverageTest, ChallengeUILocaleTest pass; spotless:check, checkstyle:check and spotbugs:check are clean
  • Full suite: 354 of 357 pass; the 3 errors (Cypress, Challenge44, Challenge45) need Docker, which was not available locally
  • The workflow was run in my fork and printed the decrypted secret

Questions for maintainers

  • The issue title mentions a separate repo. I went with the key-in-workflow approach
    from the later comment, which works for forks of this repo. Happy to move the workflow
    to a separate repo if you prefer.
  • The translations are machine-assisted; a native-speaker check would be welcome.
  • The localization coverage test hard-codes the number of challenges, so whichever of the
    open challenge PRs merges later needs a rebase there.

GitHub does not copy repository secrets to forks. Challenge 77 shows the
tempting workaround: commit the secret encrypted in a workflow and keep the
AES key and IV right next to it, so every fork can decrypt it.

- add .github/workflows/challenge77.yml (manual trigger, decrypts with openssl)
- add Challenge77 that decrypts the same ciphertext as its answer
- add explanation, hint and reason in en, nl, de, es, fr and uk
- register the challenge and bump the localization coverage counts
- add Challenge77Test, which also checks the workflow and Java stay in sync

Closes OWASP#425
@github-actions

Copy link
Copy Markdown

🧪 Testing this PR locally

If you already have the repository

First, make sure the official OWASP WrongSecrets repository is configured
as the wrongsecrets-upstream remote:

git remote get-url wrongsecrets-upstream >/dev/null 2>&1 || \
  git remote add wrongsecrets-upstream https://github.com/OWASP/wrongsecrets.git

Then fetch and check out this PR:

git fetch wrongsecrets-upstream pull/2810/head:pr-2810
git checkout pr-2810

If you already have a wrongsecrets-upstream remote, the first command
leaves it unchanged.

Or, if you want the contributor branch directly

If the contributor repository is already configured as origin:

git fetch origin
git checkout -b test-pr-2810 origin/feat/challenge-77-forkable-actions-secret

🌍 Reviewing translations

Compare the translated files of this PR side by side with the originals:
open the translation review.
Change the lang parameter in the URL to review another language.

🧹 Cleaning up after testing

When you are finished testing, you can remove the local PR branch:

git checkout main
git branch -D pr-2810

If you added the wrongsecrets-upstream remote specifically for testing
this PR and no longer need it, remove it with:

git remote remove wrongsecrets-upstream

⚠️ Only remove wrongsecrets-upstream if you added it for this test.
If you already had this remote before testing, keep it.

PR: #2810
Branch: feat/challenge-77-forkable-actions-secret
Repository: prx-my/wrongsecrets

@prx-my
prx-my marked this pull request as ready for review November 22, 2026 10:07
Copilot AI balanced review requested due to automatic review settings November 22, 2026 10:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Same suppression as challenges 54 and 63: CBC matches the openssl enc command in the workflow, which does not support GCM.
CodeQL treats AES/CBC/PKCS5Padding as insecure and the codeql[] comment did not reliably suppress it. CTR has no padding, is supported by openssl enc, and is accepted by CodeQL. The ciphertext is re-encrypted with the same key and IV.
@commjoen

Copy link
Copy Markdown
Collaborator

Hey @prx-my ! Thank y ou for your MR! Can you please rename your challenge to challenge79? the other 2 slots are taken and i would like to prevent name colissions and merge issues.

@prx-my

prx-my commented Nov 23, 2026

Copy link
Copy Markdown
Author

Hey @prx-my ! Thank y ou for your MR! Can you please rename your challenge to challenge79? the other 2 slots are taken and i would like to prevent name colissions and merge issues.

for sure, not an issue, doing it now!

Challenges 77 and 78 are taken by other open PRs, as requested by the maintainer.
@prx-my prx-my changed the title feat: add challenge 77 with forkable encrypted GitHub Actions secret feat: add challenge 79 with forkable encrypted GitHub Actions secret Nov 23, 2026
@prx-my

prx-my commented Nov 23, 2026

Copy link
Copy Markdown
Author

Done, renamed to challenge 79 (files, class, workflow challenge79.yml, docs and config). I also switched the encryption from AES-CBC to AES-CTR so CodeQL no longer flags it. Could you approve the workflow runs when you have a moment? Thanks!

@prx-my

prx-my commented Nov 24, 2026

Copy link
Copy Markdown
Author

Ci's green , ready to land ?

@commjoen

Copy link
Copy Markdown
Collaborator

Will do a review later: a bit busy with family and work.

@prx-my

prx-my commented Nov 24, 2026

Copy link
Copy Markdown
Author

Will do a review later: a bit busy with family and work.

ok

This branch has not been deployed

No deployments
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.

Create a separate repo where you allow actions to run, so you can get the secret out

4 participants