Skip to content

Commit 777c1e6

Browse files
committed
Small vuln fix and version updates
1 parent 79994aa commit 777c1e6

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

helm/wrongsecrets-ctf-party/templates/wrongsecrets-balancer/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
- name: WRONGSECRETS_TAG
6060
value: {{ .Values.wrongsecrets.tag}}
6161
- name: WRONGSECRETS_DESKTOP_TAG
62-
value: 1.5.7RC1
62+
value: 1.5.7
6363
- name: REACT_APP_CREATE_TEAM_HMAC_KEY
6464
value: hardcodedkey
6565
- name: SECRETS_MANAGER_SECRET_ID_1

helm/wrongsecrets-ctf-party/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ wrongsecrets:
9696
maxInstances: 500
9797
# -- Juice Shop Image to use
9898
image: jeroenwillemsens/wrongsecrets
99-
tag: 1.5.5-no-vault
99+
tag: 1.5.7-no-vault
100100
# -- Change the key when hosting a CTF event. This key gets used to generate the challenge flags. See: https://github.com/commjoen/wrongsecrets#ctf
101101
ctfKey: "[email protected]!9uR_K!NfkkTr"
102102
# -- Specify a custom Juice Shop config.yaml. See the JuiceShop Config Docs for more detail: https://pwning.owasp-juice.shop/part1/customization.html#yaml-configuration-file

wrongsecrets-balancer/src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ app.get('/balancer/dynamics', (req, res) => {
6666
heroku_wrongsecret_ctf_url: process.env['REACT_APP_HEROKU_WRONGSECRETS_URL'],
6767
ctfd_url: process.env['REACT_APP_CTFD_URL'],
6868
s3_bucket_url: process.env['REACT_APP_S3_BUCKET_URL'],
69-
hmac_key: process.env['REACT_APP_CREATE_TEAM_HMAC_KEY'],
69+
hmac_key: process.env['REACT_APP_CREATE_TEAM_HMAC_KEY'] || 'hardcodedkey',
7070
enable_password: usePassword,
7171
});
7272
});

wrongsecrets-balancer/src/proxy/proxy.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ function proxyTrafficToJuiceShop(req, res) {
152152
// `we have cookies: ${JSON.stringify(req.cookies)} and ${JSON.stringify(req.signedCookies)}`
153153
// );
154154
const upgradeTeamname = extractTeamName(req);
155+
const regex = new RegExp('^[a-z0-9]([-a-z0-9])+[a-z0-9]$', 'i');
156+
if (!regex.test(upgradeTeamname)) {
157+
logger.info(`Got malformed teamname: ${upgradeTeamname}s`);
158+
return res.redirect('/balancer/');
159+
}
155160
logger.info(`proxying upgrade request for: ${req.url} with team ${upgradeTeamname}`);
156161
proxy.ws(req, socket, head, {
157162
target: `ws://${upgradeTeamname}-virtualdesktop.${upgradeTeamname}.svc:8080`,

0 commit comments

Comments
 (0)