do not leak flags
This commit is contained in:
+2
-1
@@ -156,7 +156,8 @@ def flag_is_valid(c: Challenge, d: Description) -> list[str]:
|
||||
b = []
|
||||
content = str(d.flag.get("content") or "")
|
||||
if not FLAG_RE.match(content):
|
||||
b.append(f"flag {content} is not h4tum{{...}}" if content else "no flag in description.yml")
|
||||
# never print the content: a wrong prefix or stray whitespace still leaves a real flag
|
||||
b.append("flag in description.yml is not h4tum{...}" if content else "no flag in description.yml")
|
||||
if d.flag.get("dynamic") and not any(isinstance(x.get("flag"), dict) for x in d.containers):
|
||||
b.append("dynamic flag, but no container is handed one")
|
||||
return b
|
||||
|
||||
Reference in New Issue
Block a user