Skip to main content
Challenges Leaking sensitive data via template injection
PWN Medium Template injection Solves: 6

Leaking sensitive data via template injection

Author: CyberSamSU
Points
55

This is a REAL, executable Python program (attached xabar_xizmati.py). Python has its own issue similar to the "format string" vulnerability in C: if the user is allowed to write the template itself (via str.format()), they can write an ATTRIBUTE PATH (for example, obyekt.__class__.nom) inside {...} and "reach into" arbitrary objects within the program.

The developer has banned popular "sandbox escape" words (__class__, __subclasses__, import, etc.). But read the file carefully — the BANNED list DOES NOT COVER the real error. Your task: find a single template string for the xabar_yasa() function that is not banned, but leaks the module's _MAXFIY_ENC list (the encrypted flag).

The found (leaked) list is encrypted with the XOR key _XOR_KALIT — if you XOR each element with _XOR_KALIT, the characters (ASCII codes) of the flag text will emerge.

Find the required template by running the program locally (or simply by carefully analyzing the source code).

Attached files
xabar_xizmati.py Log in to download
SHA-256 checksums
xabar_xizmati.py: 438f0a1f37e131021cf81559b41112faa4e4c45df914853086e50386a3333d9c
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −5 pts Log in
Hint 2 −11 pts Log in
Hint 3 −16 pts Log in
To submit a flag, log in.

First solvers

1. W.o.X 09.09.2026
2. testrejim 09.10.2026
3. Mirjaxon Qaxxarov 27.10.2026
4. Odam 05.11.2026
5. arcanum 11.11.2026
6. Furqat Turayev 11.11.2026