Skip to content

Updated a loophole for level 7 #17

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions webapp/xss_trainer/levels/contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ class EscapeChars(meta.BaseLevel):
author = "Sharkmoos"

def sanitise(self, data):
# This is more of a level 2/3 difficulty
payload = (data.replace("'", "\\'")).replace('"', '\\"')
try:
int(data)
payload = (data.replace("'", "\\'")).replace('"', '\\"')
except ValueError:
payload = "You must enter a string payload for this level"
return payload

class Encoding(meta.BaseLevel):
Expand Down