-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Bonus Payload" XSS payload broken from HTML entity encoding [🐛] #104
Comments
Hello, I've tested this bug locally, the issue is indeed that the first diff --git a/index.js b/index.js
index 3763f4e..1baac1c 100644
--- a/index.js
+++ b/index.js
@@ -104,6 +104,12 @@ const juiceShopCtfCli = async () => {
fetchCodeSnippets(answers.juiceShopUrl, argv.ignoreSslWarnings, answers.insertHintSnippets === options.noHintSnippets)
])
+ for (const challenge of challenges) {
+ if (challenge.name === 'Bonus Payload') {
+ challenge.description = challenge.description.replace('https://', 'https%3A//');
+ }
+ }
+
await generateCtfExport(answers.ctfFramework || options.ctfdFramework, challenges, {
juiceShopUrl: answers.juiceShopUrl,
insertHints: answers.insertHints, |
This seems fine, it's a workaround but it seems that's what it takes in this very specific case... 😆 |
My issue with this approach (and the reason I closed the PR) is that the iframe payload gets broken because the %3A encoding does not get resolved correctly when you use it as beginning of url in the src tag :( |
Hmm, yeah, the payload does not work in the challenge if |
Okay, it appears that using html encoding instead of URL encoding fixes it completely. diff --git a/index.js b/index.js
index 1baac1c..d409bc3 100644
--- a/index.js
+++ b/index.js
@@ -106,7 +106,7 @@ const juiceShopCtfCli = async () => {
for (const challenge of challenges) {
if (challenge.name === 'Bonus Payload') {
- challenge.description = challenge.description.replace('https://', 'https%3A//');
+ challenge.description = challenge.description.replace('https://', 'https://');
}
} |
🐛 Bug report
Description
At least in CTFd the payload as part of the "Bonus Payload" challenge description is this
where on the Juice Shop score board it is actually
Copy/paste of the payload from CTFd doesn't work, which might be confusing/frustrating to users.
The text was updated successfully, but these errors were encountered: