Skip to content

Commit

Permalink
Merge pull request #58 from squ1rrel-ctf/burgess/csaw
Browse files Browse the repository at this point in the history
Burgess/csaw
  • Loading branch information
kyleburgess2025 authored Sep 10, 2024
2 parents 73b7e00 + b5ca96c commit f3ee07b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _posts/2024-09-09-csaw-lost-pyramid.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Basically, if you set `algorithms=jwt.algorithms.get_default_algorithms()` while

Except... we're not done. First off, we don't know the public key. Second off, we don't know the King's Day, which we need to include in our payload. That's where SSTI comes in. SSTI stands for server-side template injection; basically, we can expose variables from the code by injecting our own code. I actually couldn't figure this out for a while until I called fellow teammate Nisala Kalupahana calmly and nicely pointed out these lines of code:

{% raw %}

```python
kings_safelist = ['{','}', '𓁹', '𓆣','π“€€', '𓀁', '𓀂', '𓀃', '𓀄', 'π“€…', '𓀆', '𓀇', 'π“€ˆ', '𓀉', 'π“€Š',
'𓀐', '𓀑', 'π“€’', '𓀓', 'π“€”', '𓀕', 'π“€–', 'π“€—', 'π“€˜', 'π“€™', 'π“€š', 'π“€›', 'π“€œ', '𓀝', 'π“€ž', 'π“€Ÿ',
Expand Down Expand Up @@ -68,6 +70,8 @@ Do you see that? `**globals()`. This passes all global variables into the contex

Payload: `{{KINGSDAY}}𓁹{{PUBLICKEY}}`:

{% endraw %}

Result:
![A photo of the inside of a pyramid with the public key and the kingsday written on it.](/assets/csaw/kyleburgess2025/scarab_key.webp)
*What a beautiful name for a baby boy.*
Expand Down

0 comments on commit f3ee07b

Please sign in to comment.