quiz

C# puzzles

2024 Jan 31 #quiz

Two puzzles about funny C# behavior I discovered in the past.

The first one is fully defined, the second one is Quite Clever.

Spot the bug: Bad Escape

2023 Jul 19 #security #quiz

Hi! I wrote some Excellent Javascript that lets you change an image based on the funny little characters you type in the box at the bottom. I’ve vaguely heard of XSS, so I know that I should escape the characters, so I copied the escaping rules from Tera.

Namely, replacing &, <, >, ", \``, and /` with their associated HTML entities.

Your task is to call submitFlag with the string value <>. If you succeed, I will alert a fun message for you :)

recursive main() implicit return

#quiz #is it ub #C
#include <stdio.h>

static int first_call = 1;

int main() {
    if (first_call) {
        first_call = 0;
        int x = main();
        if (x == 0) {
            printf("hi!\n");
        }
    }

    // implicitly return
}