Repository navigation
Conversation
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
🧪 Testing this PR locallyIf you already have the repositoryFirst, make sure the official OWASP WrongSecrets repository is configured git remote get-url wrongsecrets-upstream >/dev/null 2>&1 || \
git remote add wrongsecrets-upstream https://github.com/OWASP/wrongsecrets.gitThen fetch and check out this PR: git fetch wrongsecrets-upstream pull/2810/head:pr-2810
git checkout pr-2810
Or, if you want the contributor branch directlyIf the contributor repository is already configured as git fetch origin
git checkout -b test-pr-2810 origin/feat/challenge-77-forkable-actions-secret🌍 Reviewing translationsCompare the translated files of this PR side by side with the originals: 🧹 Cleaning up after testingWhen you are finished testing, you can remove the local PR branch: git checkout main
git branch -D pr-2810If you added the git remote remove wrongsecrets-upstream
PR: #2810 |
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.
|
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.
|
Done, renamed to challenge 79 (files, class, workflow |
|
Ci's green , ready to land ? |
|
Will do a review later: a bit busy with family and work. |
ok |
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.ymlships the secret AES-256-CTR encrypted and keeps thekey 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_dispatchonly,contents: read, no third-party actionsChallenge79.java:FixedAnswerChallengethat decrypts the same ciphertext with the JDK's AES-CTRwrong-secrets-configuration.yaml(CI/CD, easy, CTF enabled)Challenge79Test, including a check that the Java constants match the workflowAES-CTR instead of CBC: CodeQL flags
AES/CBC/PKCS5Padding(padding oracle), CTR has nopadding, is supported by
openssl enc, and passes CodeQL. SpotBugsCIPHER_INTEGRITYissuppressed with a justification, as in challenges 54 and 63.
Testing
Challenge79Test,ChallengeContentLocalizationCoverageTest,ChallengeUILocaleTestpass;spotless:check,checkstyle:checkandspotbugs:checkare cleanQuestions for maintainers
from the later comment, which works for forks of this repo. Happy to move the workflow
to a separate repo if you prefer.
open challenge PRs merges later needs a rebase there.