crash course: a groovy jar that carries its own crash dump
huntress ctf 2026, day 26 · binary · all three modes
tools used: binary-analysis toolkit and timed-attempt pipeline.
"it crashed. that's the good news: the dump is a confession. unwind the stack, find the faulting instruction, and triage what went wrong from the wreckage." the day's new tag was one java archive compiled from groovy, with its crash dump stored beside the classes as a small json member.
the key insight: the question spells the recipe. "parse crash/trace.json and submit the exact first string in its frames array" names a member by path and a key by name; the second new field compares that array with the method names of the jar's main class. both answers sit in a json member of about a hundred bytes and one class file's method table, and neither needs the stack to be unwound by hand. the bytecode is still worth reading once, because it shows the dump is the program's own account of its fault.
challenge shape
single 312 fields 26 tags (d01..d26), twelve fields each; d26:
the member's hash and format, the hcfg config
and its header fields, the main class's method
count, and two crash fields
time trial 312 fields the same fields over a fresh bundle
mastery 3120 fields the same fields over ten bundles
the two crash fields were new: the fault method ("the exact first string in its frames array") and a predicate, lowercase true or false, that holds exactly when every string in the frames array is in the primary class file's method-name set. the question words it as "evaluate this public predicate and submit lowercase true or false: true exactly when every string in crash/trace.json frames is present in the primary classfile method-name set", an enum of true and false. the method count's question names its class the same way: "for day 26 use the primary classfile named by that unit. submit its classfile method-table count in base 10."
artifact anatomy
the d26 member is d26--sample.jar, a few kib, stored encrypted inside the evidence zip like every other member. it holds a manifest whose Main-Class names the main class and whose Created-By names a groovy build factory, two class files (the main class and a closure class the groovy compiler generated for main), and the crash dump:
{"schema": "<a synthetic crash schema id>",
"kind": "<exception class>",
"frames": ["<innermost>", "<middle>", "<outermost>"]}
the frames are method names only, no classes, files or line numbers, and the faulting frame comes first, the order a java stack trace prints.
the main class declares three static methods for the stages of the fault. the outermost calls the middle one, the middle calls the innermost, and the innermost does one thing: it builds an IllegalStateException with a fixed message and throws it. that athrow is the faulting instruction the prompt asks about. groovy compiles every call between them as an invokedynamic through groovy's own bootstrap method, with the callee's name as a bootstrap argument, so the calls do not appear as method references in the constant pool; the method table is where the names are.
main reads two environment variables. the first is a host model with a default, which picks a branch label and an event count; the second turns the fault on. with the fault on, main calls the outermost stage inside a try, catches the exception, walks its stack trace for the first element whose class is the main class, and prints a one-line json trace with the exception's simple class name as the fault kind and that element's method name as the fault method. with the fault off it prints the same line with both set to none. the program's own report and the stored dump therefore name the same frame: the innermost one, which is the dump's first string.
the configuration record is the event's hcfg blob, base64 in a static string constant of the main class, read as on days 24 and 25.
extraction method
the binary toolkit answers each field by its producer. the ten older fields of the tag (hash, format jar, the hcfg record and its header bytes, the method count) came from producers that earlier jars built. the two crash fields go through a reader added on day 26: it opens the jar, takes the one member whose path looks like a crash or trace json, and returns its object with normalized keys.
def crash_trace(jar: bytes) -> dict[str, Any]:
z = open_zip(jar)
hits = [n for n in z.namelist() if CRASH_MEMBER.search(n)]
if len(hits) != 1:
raise ValueError(f"crash_*: {len(hits)} crash json members in the jar")
found = json.loads(read_member(z, hits[0]))
if not isinstance(found, dict):
raise ValueError(f"crash_*: {hits[0]} is no json object")
return {snake(k): v for k, v in found.items()}
def crash_fault_method(jar: bytes) -> str:
return frames(jar)[0]
def crash_frames_match_methods(jar: bytes) -> str:
names = {m.name for m in java.program(jar).main.methods}
return "true" if all(f in names for f in frames(jar)) else "false"
these are compound.crash_trace and the crash_* producers beside it; java.program is the class-file parser the toolkit has had since day 10: it reads the manifest's Main-Class, parses that class file and lists its method table, so the set includes the stage methods, main, the constructor and the methods groovy adds to every class. by hand, unzip -p d26--sample.jar crash/trace.json prints the dump and javap -p on the Main-Class lists the method names to compare.
validation and answer formatting
the crash reader refuses a jar with no crash json or with more than one, and a dump without a non-empty frames list, rather than guessing which member or key was meant. the comparison with the method table is exact and case-sensitive, as java names are; a frame that names a method of the closure class or of the runtime would not be in the main class's table. the fault method is submitted as stored, stageThree for every bundle of the day, and the predicate as its lowercase word: true in the single, the time trial and all ten mastery bundles, since every frame named one of the main class's stage methods.
failed approaches and pivots
the single's first run read all but two of the full field set and stopped on the two crash names, for which no producer existed. the nearest existing reading was the class file's method count, which shares the word method with one of them and nothing else. the json that held both answers was a member of about a hundred bytes; printing a small member a question names by path is cheaper than any search for a reader that shares its words.
automation across modes
every timed bundle's crash dump had the same three keys and three frames, so the new producers answered all eleven d26 members of the time trial and the mastery. a 312-field bundle solved in about half a second once on disk; most of each timed mode was downloading the bundles, tens of megabytes each and ten of them for the mastery.
lessons
- when a question names a member by path and a key by name, read that member first; a json of about a hundred bytes is its own documentation.
- a crash dump and the code that writes it should agree: here the catch block's stack walk names the same innermost frame the dump lists first, which is the cross-check a triage needs.
- groovy's calls are
invokedynamicsites, so call graphs come from bootstrap arguments, and method names from the method table, not from method references.
solve times
public scoreboard · day 26 finish: below top 10
- 1:02.3single#4 of 155 solvers
- 1:06.6time trial#2 of 151 solvers
- 1:17.5mastery#2 of 149 solvers
- #32team day finishof 135 teams that cleared it, in 19:21.9
- #4single orderof the day's 7, by our flag time
from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.
from the mode's first start on the game master to its correct submit.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 60.7s | 1 | 0 |
| time trial | 2.8s | 1 | 0 |
| mastery | 8.8s | 1 | 0 |
the clock
server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.
| mode | time available | time used | time left |
|---|---|---|---|
| time trial | 80.0s | 2.8s | 77.2s |
| mastery | 660.0s | 8.8s | 651.2s |
where we got stuck
- single, about 54 seconds from the first run to the flag: no reader of a jar's crash json existed, and the closest reading by name was the method count, a different member and a different question. the fix read the json by its path and parsed the main class's method names with a parser of its own, although the class-file reader already lists them. the crash reader and its producers (the fault method, the first and last frame, the frame count, the predicate, the exception kind and any other key of the dump by name) now answer these fields on the first run.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}